9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)|[Week 59](https://reddit.com/b50r5y)|[Week 69](https://reddit.com/cvde5a)|[Week 79](https://reddit.com/entcxy)|[Week 89](https://reddit.com/gu5t0d)|[Week 99](https://reddit.com/jqjgo2)||
|[Week 10](https://www.reddit.com/56s2oa)|[Week 20](https://www.reddit.com/5wh2wb)|[Week 30](https://www.reddit.com/6p3ha7)|[Week 40](https://www.reddit.com/7qel9p)|[Week 50](https://reddit.com/9cf158)|[Week 60](https://reddit.com/bakew0)|[Week 70](https://reddit.com/d1g1k9)|[Week 80](https://reddit.com/euctyw)|[Week 90](https://reddit.com/hddf7j)|[Week 100](https://reddit.com/jz3evt)||
Most upvoted
/r/MachineLearning
https://redd.it/ljx92n
|[Week 10](https://www.reddit.com/56s2oa)|[Week 20](https://www.reddit.com/5wh2wb)|[Week 30](https://www.reddit.com/6p3ha7)|[Week 40](https://www.reddit.com/7qel9p)|[Week 50](https://reddit.com/9cf158)|[Week 60](https://reddit.com/bakew0)|[Week 70](https://reddit.com/d1g1k9)|[Week 80](https://reddit.com/euctyw)|[Week 90](https://reddit.com/hddf7j)|[Week 100](https://reddit.com/jz3evt)||
Most upvoted
/r/MachineLearning
https://redd.it/ljx92n
reddit
Machine Learning - WAYR (What Are You Reading) - Week 9
This is a place to share machine learning research papers, journals, and articles that you're reading this week. If it relates to what you're...
Let's build a Social Network with Django in 1 month (Day 14 of 28) (Daily Coding Vlogs)
https://www.youtube.com/watch?v=1TpBSa3j0k0&ab_channel=IsaacJoy
/r/django
https://redd.it/lk1so7
https://www.youtube.com/watch?v=1TpBSa3j0k0&ab_channel=IsaacJoy
/r/django
https://redd.it/lk1so7
YouTube
Let's build a Social Network in 1 month (Day 14 of 28)
building a social network in the month - sign up: https://chitterchat.comtech stack - nuxt.js(vue.js) / django / postgrescode: https://gitlab.com/isaacjoy/ch...
Deploying tensorflow linear classifier pretrained model to web server using Flask
Hi,
I'm having an issue with deployment of a Flask app that uses a tensorflow model to make predictions on data provided by a user.
The code works fine in a local environment, but fails silently when pushed to my web server.
The code I'm using is functionally the same as the code in this tutorial: https://www.tensorflow.org/tutorials/estimator/linear
This is the output locally: https://gyazo.com/041dacfa584832f109cbf5b1fd09f0a8
edit: on the web server it simply can't load any pages. They seem to timeout - no internal server error or anything.
Which normally means a function can't be found.
​
It seems to be silently failing - I can't find a log in my ubuntu machine being useful to me.
/r/flask
https://redd.it/lk13ng
Hi,
I'm having an issue with deployment of a Flask app that uses a tensorflow model to make predictions on data provided by a user.
The code works fine in a local environment, but fails silently when pushed to my web server.
The code I'm using is functionally the same as the code in this tutorial: https://www.tensorflow.org/tutorials/estimator/linear
This is the output locally: https://gyazo.com/041dacfa584832f109cbf5b1fd09f0a8
edit: on the web server it simply can't load any pages. They seem to timeout - no internal server error or anything.
Which normally means a function can't be found.
​
It seems to be silently failing - I can't find a log in my ubuntu machine being useful to me.
/r/flask
https://redd.it/lk13ng
TensorFlow
Build a linear model with Estimators | TensorFlow Core
Deploying Flask app using Procfile and .env file with Postgres
I am trying to deploy my Flask app to a VPS installed with Dokku. I don't have much knowledge in regards to Docker deployment, but Dokku seems to pull it all together using Herokuish. However, I am having some difficulties pushing my app to my Dokku instance.
My directory/file structure looks a little something like this:
.env
run.py
Procfile
requirements.txt
config.py
spotifyproject
│ init.py
│
└───api
│ │ spotifyhandler.py
│ │ spotifyclient.py
│ │ spotifyauth.py
│
└───user (user login/signup routes & db handling)
│
└───models (user & like models)
│
└───profile (routes for displaying content from /api)
Then in some of the files:
# Procfile
web: gunicorn spotifyproject:run
# spotifyproject/init.py
/r/flask
https://redd.it/ljz3u1
I am trying to deploy my Flask app to a VPS installed with Dokku. I don't have much knowledge in regards to Docker deployment, but Dokku seems to pull it all together using Herokuish. However, I am having some difficulties pushing my app to my Dokku instance.
My directory/file structure looks a little something like this:
.env
run.py
Procfile
requirements.txt
config.py
spotifyproject
│ init.py
│
└───api
│ │ spotifyhandler.py
│ │ spotifyclient.py
│ │ spotifyauth.py
│
└───user (user login/signup routes & db handling)
│
└───models (user & like models)
│
└───profile (routes for displaying content from /api)
Then in some of the files:
# Procfile
web: gunicorn spotifyproject:run
# spotifyproject/init.py
/r/flask
https://redd.it/ljz3u1
reddit
Deploying Flask app using Procfile and .env file with Postgres
I am trying to deploy my Flask app to a VPS installed with Dokku. I don't have much knowledge in regards to Docker deployment, but Dokku seems to...
For any pandas users, I just finished adding a full UI for merging & stacking dataframes to free pandas visualizer
​
Merging & Stacking in D-Tale 1.35.0
I recently added the ability to merge & stack (vertically concatenate) dataframes in my open-source Pandas Dataframe Visualizer, D-Tale
Feel free to play with the demo here
This recording is a demo of the new "Merge & Stack" feature of D-Tale. You'll see the following:
Editing of parameters to either a pandas merge or stack (vertical concatenation) of dataframes (and viewing examples from the pandas documentation)
Selection of dataframes & viewing the data within them after selection
Uploading of additional dataframes from an excel file
Viewing python code snippets & resulting data from a merge or stack
D-Tale is available on both pypi & conda:
`pip install dtale`
Please let me know if theres anything else I can do to make this functionality better and support open-source by tossing your star on the repo. Thanks!
/r/Python
https://redd.it/lk69l1
​
Merging & Stacking in D-Tale 1.35.0
I recently added the ability to merge & stack (vertically concatenate) dataframes in my open-source Pandas Dataframe Visualizer, D-Tale
Feel free to play with the demo here
This recording is a demo of the new "Merge & Stack" feature of D-Tale. You'll see the following:
Editing of parameters to either a pandas merge or stack (vertical concatenation) of dataframes (and viewing examples from the pandas documentation)
Selection of dataframes & viewing the data within them after selection
Uploading of additional dataframes from an excel file
Viewing python code snippets & resulting data from a merge or stack
D-Tale is available on both pypi & conda:
`pip install dtale`
conda install dtale -c conda-forgePlease let me know if theres anything else I can do to make this functionality better and support open-source by tossing your star on the repo. Thanks!
/r/Python
https://redd.it/lk69l1
GitHub
GitHub - man-group/dtale: Visualizer for pandas data structures
Visualizer for pandas data structures. Contribute to man-group/dtale development by creating an account on GitHub.
Should I use Django for this project?
Hi all. I'm decent at python, decent at html (neither one is my job, programming is a hobby and eventually maybe more). I keep using programming to build things I actually use. Here's my website I plan to make, I'd like to get a quick "Yes, do this in Django" or "oh god no, thats not what this is for, go use XYZ".
​
I'm teaching a class for 6 months, all online. I want to build a website for the class. My initial thought is
​
Google to login (nearly everyone has this). can't get past the landing page without being logged in. I'm being paid separately(not by each person), so if extra people join it doesn't really matter.
Landing page with a bit of "this is what is here"
each week of the class has its own page, like a blog post.
each post has
\- required reading
\- link to the zoom meeting. This would go dark after class is done for the week
\- link to the YouTube recording. This would be added after the video is uploaded.
\- An email the instructor (me) form.
\- Link to the practice test for that chapter.
\--- I need a testing
/r/djangolearning
https://redd.it/lk6hpq
Hi all. I'm decent at python, decent at html (neither one is my job, programming is a hobby and eventually maybe more). I keep using programming to build things I actually use. Here's my website I plan to make, I'd like to get a quick "Yes, do this in Django" or "oh god no, thats not what this is for, go use XYZ".
​
I'm teaching a class for 6 months, all online. I want to build a website for the class. My initial thought is
​
Google to login (nearly everyone has this). can't get past the landing page without being logged in. I'm being paid separately(not by each person), so if extra people join it doesn't really matter.
Landing page with a bit of "this is what is here"
each week of the class has its own page, like a blog post.
each post has
\- required reading
\- link to the zoom meeting. This would go dark after class is done for the week
\- link to the YouTube recording. This would be added after the video is uploaded.
\- An email the instructor (me) form.
\- Link to the practice test for that chapter.
\--- I need a testing
/r/djangolearning
https://redd.it/lk6hpq
reddit
Should I use Django for this project?
Hi all. I'm decent at python, decent at html (neither one is my job, programming is a hobby and eventually maybe more). I keep using programming...
How to Deploy a flask app to the web with Google Cloud Run
Hi guys,
I would like to bring my App to the web using Google Cloud Services. Docker ist completely new to me and Cloud run as well.
Is there a good tutorial on how to install it from scratch?
My firebase DB already works 😇
/r/flask
https://redd.it/lkcqd6
Hi guys,
I would like to bring my App to the web using Google Cloud Services. Docker ist completely new to me and Cloud run as well.
Is there a good tutorial on how to install it from scratch?
My firebase DB already works 😇
/r/flask
https://redd.it/lkcqd6
reddit
How to Deploy a flask app to the web with Google Cloud Run
Hi guys, I would like to bring my App to the web using Google Cloud Services. Docker ist completely new to me and Cloud run as well. Is there a...
Where would i write backend scripts?
Im kinda new to django and always had this question in the back of my mind, lets say i wanted to use like bs4 to scrape a website, where would i put that script? in models or in the view function or if not those where?
/r/django
https://redd.it/lkdccy
Im kinda new to django and always had this question in the back of my mind, lets say i wanted to use like bs4 to scrape a website, where would i put that script? in models or in the view function or if not those where?
/r/django
https://redd.it/lkdccy
reddit
Where would i write backend scripts?
Im kinda new to django and always had this question in the back of my mind, lets say i wanted to use like bs4 to scrape a website, where would i...
Understanding the Flask WTForms validation popup
Hello, this is my first post in this forum please don't be rude thank you :)
I'm currently having a hard time understanding and especially styling the "Form Validation Error Message" or whatever you call it.
TL;DR:
How is the popup from the picture attached displayed, and how can I style it with CSS?
Most approximate Stack Overflow thread I found: Link (didn't help me)
​
Validation Popup
​
Long story with explanation:
I made a sample application with Flask-Security-too, SQLAlchemy, Flask-Mail, WTForms and all this cool stuff (this is not the first time I'm using Flask)
On the Picture is a sample Form that consists of 2 inputs, a title, which is required and a text, which is not. If you try to save this, it's displaying this popup kinda thing that says it can't be empty.
Everything is good till here, because I don't even know how this is rendered? I removed every macro that renders errors and blocked every possible JavaScript function. It is still able to render a popup without a page reload. (The HTML is clean, there's nothing that shouldn't be there).
Can anyone explain this to me? I'm reading the source code right now, and I can't really find something there either...
And maybe also how this
/r/flask
https://redd.it/lkg4w6
Hello, this is my first post in this forum please don't be rude thank you :)
I'm currently having a hard time understanding and especially styling the "Form Validation Error Message" or whatever you call it.
TL;DR:
How is the popup from the picture attached displayed, and how can I style it with CSS?
Most approximate Stack Overflow thread I found: Link (didn't help me)
​
Validation Popup
​
Long story with explanation:
I made a sample application with Flask-Security-too, SQLAlchemy, Flask-Mail, WTForms and all this cool stuff (this is not the first time I'm using Flask)
On the Picture is a sample Form that consists of 2 inputs, a title, which is required and a text, which is not. If you try to save this, it's displaying this popup kinda thing that says it can't be empty.
Everything is good till here, because I don't even know how this is rendered? I removed every macro that renders errors and blocked every possible JavaScript function. It is still able to render a popup without a page reload. (The HTML is clean, there's nothing that shouldn't be there).
Can anyone explain this to me? I'm reading the source code right now, and I can't really find something there either...
And maybe also how this
/r/flask
https://redd.it/lkg4w6
Stack Overflow
Flask form validation error prompt message
I made a form to reset password, when I submit the form with an empty password, the error prompt words I set in views.py didn't show up at the <span> I left in a HTML, a default Fill out this...
META What happened to r/Python?
I've not been on r/Python in quite a while because life. I visited daily maybe 12-18 months ago and I remember the content here was a lot more discussion about the language itself, with a few pandas and datascience tutorials sprinkled in. Many threads had long discussions that were interresting to read.
Now it seems 90% of posta have less than 3 comments and the posts are mainly beginner showcases (that nobody cares about judging from the amount of comments they get) or some youtube tutorial about machinelearning or building a twitter/discord bot in 4 lines og python.
Is it just me or has this community changed a lot during the pandemic? r/Python used to be the fist thing I checked out on reddit. Not so much anymore unfortunately.
/r/Python
https://redd.it/lk9xbx
I've not been on r/Python in quite a while because life. I visited daily maybe 12-18 months ago and I remember the content here was a lot more discussion about the language itself, with a few pandas and datascience tutorials sprinkled in. Many threads had long discussions that were interresting to read.
Now it seems 90% of posta have less than 3 comments and the posts are mainly beginner showcases (that nobody cares about judging from the amount of comments they get) or some youtube tutorial about machinelearning or building a twitter/discord bot in 4 lines og python.
Is it just me or has this community changed a lot during the pandemic? r/Python used to be the fist thing I checked out on reddit. Not so much anymore unfortunately.
/r/Python
https://redd.it/lk9xbx
reddit
[META] What happened to r/Python?
I've not been on r/Python in quite a while because life. I visited daily maybe 12-18 months ago and I remember the content here was a lot more...
Python strings are immutable, but only sometimes
https://web.eecs.utk.edu/~azh/blog/pythonstringsaremutable.html
/r/Python
https://redd.it/lkkl2q
https://web.eecs.utk.edu/~azh/blog/pythonstringsaremutable.html
/r/Python
https://redd.it/lkkl2q
Austinhenley
Python strings are immutable, but only sometimes
There is a common case when strings are actually mutable.
Tuesday Daily Thread: Advanced questions
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/lkqsu8
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/lkqsu8
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 413614 members
Using JWT to authenticate Flask API. I am almost done but having some issues. Can someone please help me?
I am trying to implement JWT authentication for a Flask API. I am using flask_jwt_extended. I am confused about how to persist user sessions. My API has an endpoint for login which issues an access token. I have a different resource that refreshes the token. So, how do I implement the functionality where after the access token is expired, the user is automatically issued a new access token without having to log in.
My current logic ( I believe I am missing something). After a client sends an access token and gets the response that the token is expired, it sends the refresh token to TokenRefresh resource to get a new access token and then resends the same access token. Kinda seems like a bad design. How do you guys suggest I do it?
Resource for Token Refresh
class TokenRefresh(Resource):
@jwtrefreshtokenrequired
def post(self):
currentuser = getjwtidentity()
accesstoken = createaccesstoken(identity = currentuser)
/r/flask
https://redd.it/lkpa18
I am trying to implement JWT authentication for a Flask API. I am using flask_jwt_extended. I am confused about how to persist user sessions. My API has an endpoint for login which issues an access token. I have a different resource that refreshes the token. So, how do I implement the functionality where after the access token is expired, the user is automatically issued a new access token without having to log in.
My current logic ( I believe I am missing something). After a client sends an access token and gets the response that the token is expired, it sends the refresh token to TokenRefresh resource to get a new access token and then resends the same access token. Kinda seems like a bad design. How do you guys suggest I do it?
Resource for Token Refresh
class TokenRefresh(Resource):
@jwtrefreshtokenrequired
def post(self):
currentuser = getjwtidentity()
accesstoken = createaccesstoken(identity = currentuser)
/r/flask
https://redd.it/lkpa18
reddit
Using JWT to authenticate Flask API. I am almost done but having...
I am trying to implement JWT authentication for a Flask API. I am using flask\_jwt\_extended. I am confused about how to persist user sessions. ...
Managing the version of a Flask app
I am looking for some guidance on managing the version number of my flask app. Its currently just a variable that is displayed at the footer area of the app but I want it to be more useful, such as in a way that it can either be auto-incremented through my CI/CD pipeline or perhaps something like a pre-commit hook to remind me to increment it before pushing code up.
/r/flask
https://redd.it/lkrk2v
I am looking for some guidance on managing the version number of my flask app. Its currently just a variable that is displayed at the footer area of the app but I want it to be more useful, such as in a way that it can either be auto-incremented through my CI/CD pipeline or perhaps something like a pre-commit hook to remind me to increment it before pushing code up.
/r/flask
https://redd.it/lkrk2v
reddit
Managing the version of a Flask app
I am looking for some guidance on managing the version number of my flask app. Its currently just a variable that is displayed at the footer area...
Twitterbot Python Code
I wrote a twitter bot to get a million followers on Twitter
by following hundreds of thousands of people, awaiting the follow-back, and automating unfollows after a certain time period. Rate limits immediately stumped my ambitious ideas. In hindsight it may have been a bit too ambitious.
Watch how I made it: https:\/\/www.youtube.com\/watch?v=-ZsWwbwhy6g&feature=youtu.be&ab\_channel=DylanSmith
So I remade a reddit-like posting page with a twitter bot by listening to the twitter-post stream and scraping all content in tweets made mentioning "@bestpostbot", "#bestpostbot", or simply "bestpostbot" and posting them on my bots page.
Essentially, anyone can make a post on this page by tweeting their own post and just mentioning the bot. My bot's page (https://twitter.com/bestpostbot) then serves as a space everyone can browse collectively for interesting content. "Upvote" your favorites.
The tweet with the mosts likes and retweets gets pinned and shown off at the top, while all posts on the page compete for this spot. Welcome to bestpostbot. Make a tweet.
View the relatively short code on GitHub: https://github.com/e-Dylan/bestpostbot
/r/Python
https://redd.it/lkmna0
I wrote a twitter bot to get a million followers on Twitter
by following hundreds of thousands of people, awaiting the follow-back, and automating unfollows after a certain time period. Rate limits immediately stumped my ambitious ideas. In hindsight it may have been a bit too ambitious.
Watch how I made it: https:\/\/www.youtube.com\/watch?v=-ZsWwbwhy6g&feature=youtu.be&ab\_channel=DylanSmith
So I remade a reddit-like posting page with a twitter bot by listening to the twitter-post stream and scraping all content in tweets made mentioning "@bestpostbot", "#bestpostbot", or simply "bestpostbot" and posting them on my bots page.
Essentially, anyone can make a post on this page by tweeting their own post and just mentioning the bot. My bot's page (https://twitter.com/bestpostbot) then serves as a space everyone can browse collectively for interesting content. "Upvote" your favorites.
The tweet with the mosts likes and retweets gets pinned and shown off at the top, while all posts on the page compete for this spot. Welcome to bestpostbot. Make a tweet.
View the relatively short code on GitHub: https://github.com/e-Dylan/bestpostbot
/r/Python
https://redd.it/lkmna0
Elyra 2.0 has been released (productivity features for common data science and AI tasks)
https://developer.ibm.com/articles/what-is-new-in-elyra-2-0/
/r/IPython
https://redd.it/lksaa6
https://developer.ibm.com/articles/what-is-new-in-elyra-2-0/
/r/IPython
https://redd.it/lksaa6
Java programmer coming to Python for the first time...
Decided to try and do a thing in Python for the first time in a while.
Wrote a small program to test out a library in Python that I'd originally been using the Java version of.
Keep in mind I'm very, VERY used to Java and to an extent C++.
Take a guess as to what happened.
​
It ran flawlessly with zero errors the first time I ran it.
​
Why the hell don't I use this friggin language more often.
I'm genuinely still astonished, not a single thing I've made in Java has run flawlessly the first time I run it.
So uh, hello Python. Where the hell have you been all this time?
/r/Python
https://redd.it/lkwjuq
Decided to try and do a thing in Python for the first time in a while.
Wrote a small program to test out a library in Python that I'd originally been using the Java version of.
Keep in mind I'm very, VERY used to Java and to an extent C++.
Take a guess as to what happened.
​
It ran flawlessly with zero errors the first time I ran it.
​
Why the hell don't I use this friggin language more often.
I'm genuinely still astonished, not a single thing I've made in Java has run flawlessly the first time I run it.
So uh, hello Python. Where the hell have you been all this time?
/r/Python
https://redd.it/lkwjuq
reddit
Java programmer coming to Python for the first time...
Decided to try and do a thing in Python for the first time in a while. Wrote a small program to test out a library in Python that I'd originally...
How to Read and Remove Metadata from Your Photos With Python
My latest article for the Auth0 blog shows you how to use the exif module to find all sorts of interesting information encoded in the digital photos you take: Where they were taken, which direction the camera was facing, what altitude the photo was taken at, and even the speed at which the photographer was moving! It also shows you how to alter and erase that information.
Where, when, and at what altitude was this photo taken? Python and the exif module can tell you.
/r/Python
https://redd.it/lktqyy
My latest article for the Auth0 blog shows you how to use the exif module to find all sorts of interesting information encoded in the digital photos you take: Where they were taken, which direction the camera was facing, what altitude the photo was taken at, and even the speed at which the photographer was moving! It also shows you how to alter and erase that information.
Where, when, and at what altitude was this photo taken? Python and the exif module can tell you.
/r/Python
https://redd.it/lktqyy
Auth0 - Blog
How to Read, Edit, and Erase Location and other EXIF Metadata from Your Photos With Python
An introduction to the EXIF metadata that digital cameras and smartphones include in photos, and how to read, write, and erase it using Python.
Make a Memes API using Flask - beginner's tutorial
https://youtu.be/IXnQPqKgbbQ
/r/flask
https://redd.it/ll1xxm
https://youtu.be/IXnQPqKgbbQ
/r/flask
https://redd.it/ll1xxm
YouTube
Building a REST API using Python and Flask that fetches Memes
In this video, I will show you how to make memes API that fetches memes from Reddit and returns them in JSON format.GitHub: https://github.com/jaychandra6/me...