Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

Why do I get this error sometimes? I even get it when I don't let my computer turn off/sleep or similar.

/r/JupyterNotebooks
https://redd.it/iirl50
Can passing Flask app context to multiple processes lead to problems while performing database operations using Flask-SQLAlchemy?

I am developing a backend which requires some processes to be spawned automatically, and constantly perform database operations from there. I am making use of the Flask SQLAlchemy ORM to interact with the database.

I was able to pass the 'app' variable as an argument to a new process, and perform DB operations from there. But the application requires several such processes to be running at once. Thus, several processes can be making database operations using the Flask app context, in addition to the APIs created inside of Flask itself. Can someone please tell me if this will lead to some sort of a conflict/error?

Thanks in advance!

/r/flask
https://redd.it/iiwc3t
Long term impact of using UUID as a unique identifier for models

I am developing an app that enables users to post discussion questions and allows other users to react and rate the questions. However, instead of using pk or id to map question urls I'm thinking about creating unique ids for each question using UUID. This is to prevent users from both monitoring site usage and being able to quickly iterate through questions by incrementing id.

So far, I've decided to assign each question on creation a unique id: uuid.uuid4().hex\[:6\].upper(). However, I was wondering the long term effect of this implementation. Every time I create a new object, Django will have to iterate through all existing questions. Will this have a significant computational effect over time? If so, are there any other more efficient implementations of assigning unique ids? Perform some function on the id (but then wouldn't some original issues persist)?

/r/django
https://redd.it/ij0gp3
Sunday megathread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/ij317r
I’m learning Python, but I also came across my dads old BASIC textbook. The problem solving aspect of the book is almost better than any modern one I’ve read.

/r/Python
https://redd.it/iix2ru
I made an IMDB webscraper

So this is pretty beginner, but it's my first real project, and today I finished the first version of it. Without going into to much detail, the user pastes a link to IMDB and the program scrapes the shows, gets an average rating for each season, the entire show, creates a graph with the average of each season, and then shows the user IMDB's top 250 rated TV shows and gives them the option to search for a show and see if it's in the top 250. That's pretty simplified and I won't paste all 200+ lines of code but [here is the github](https://github.com/NerdyBread/IMDB-Webscraping) if anyone is interested. I'd love any feedback that anyone has, good or bad.

/r/Python
https://redd.it/iiu17w
I made some fanart

/r/Python
https://redd.it/ij60ct
How to use Django Model Managers? understanding the Django ORM

# Model managers, understanding the Django ORM

[A video in YouTube](https://preview.redd.it/gb9xndstl3k51.png?width=1280&format=png&auto=webp&s=962eb3a6e6e63e9e28d206348e2bd751e7f29171)

​

Hey guys, recently while working on a project I bumped into model managers. I knew they existed but didn't bother to learn more about them. But then I had to work with my own custom user models in Django.

So I plowed through the documentation and learned it all.

I prepared a video for anyone who intends to learn more about them :) Keep Learning!!!

Link to video-

[How to use Django Model Managers?](https://youtu.be/gxeCoRr5zL8)

/r/Python
https://redd.it/ij9dm0
How do I optimise my Django project for speed and performance?

Hey guys, hope you are all doing well. I recently deployed a django app to Heroku and it is super slow (5 - 6 seconds on average for a page), in part because I live in India and that's also where the majority of my users are. However, I recently tried shifting my site to AWS Lambda on the Mumbai server, which resulted in RELATIVELY faster load times (2 - 3 seconds for non database pages; pages that fetch stuff from the database are approximately the same if not even slower). This led me to believe that my site may be genuinely slow because the code isn't very efficient. To confirm this, I tested the response times locally using Google Chrome Dev tools. Sure enough, the site pages were taking 1 - 2 seconds on avg. to load locally. For comparison, I also checked the response time locally for a django blog project I had done earlier, and it was around 100 - 200 milliseconds. My current Django app is actually a marketplace, and is a fair bit more complicated than the blog, but it still shouldn't be 10X slower. Any tips on how I can make it faster /

/r/django
https://redd.it/ij6ud0
How to integrate a machine learning model from Azure?

I built a machine learning model on Azure platform and want to connect it to the web app using Dash(which is built upon Flask) and the model changes continuously with the data. How do I connect the ml model with the web app?

/r/flask
https://redd.it/ij8ai0
PyCon India 2020!

Ticket sales for PyConIndia2020 are open.

Rush to get your ticket: [https://in.pycon.org/2020/#ticket](https://in.pycon.org/2020/#ticket)

PyCon India is the annual gathering of Pythonistas, run by the Indian Python community, to foster adoption of the Python programming language.

With over 250+ proposals coming in globally, job board, workshops, dev sprints, and networking opportunities. This year PyCon India 2020 is set to be the biggest one yet.

We will be having a job board where you can find exciting job openings from various companies that uses Python and related technologies in various domains like web, infra, security, embedded, or data science.

No matter if you are a student, someone who is just starting out with Python, a seasoned programmer, or looking for your first programming gig there is something for all.

To make the event inclusive and accessible to all, we have kept the ticket prices to a bare minimum of 199 INR, or roughly 2.68 USD.

Regards,

On Behalf of PyCon India Organising Team

https://preview.redd.it/2owzws0q06k51.jpg?width=1280&format=pjpg&auto=webp&s=27d11d5f1b1e20d61a748801798628c6eabf93b8

/r/flask
https://redd.it/ijfczy
Jupyter notebook on tablet?

Is there such a thing? I am on android. I am not necessarily looking to install a native android app. Just the web version isn't easy to use on tablet. Like how do you even alt-enter or ctrl-enter on a tablet keyboard?

Maybe not even the full functionality of jupyter but is there a mobile website for such a thing?

/r/JupyterNotebooks
https://redd.it/ij7hj6
I made a terminal-based presentation tool with colors and effects!

Hey everyone, I made `present` which is a terminal-based presentation tool with some extra goodies! You can write slides using Markdown (I also plan to add Jupyter notebook support) and also play codios (pre-recorded playable code blocks) which can be useful for live demos! Here's the [code on Github](https://github.com/vinayak-mehta/present). And here's a demo:

​

https://i.redd.it/ei6flui6i5k51.gif

/r/Python
https://redd.it/ijdmca
Monday megathread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code!

/r/Python
https://redd.it/ijnjcu
Django and react

Hi there,

I'm a senior ruby developer who is now working on a fair big project made in django.

With ruby on rails there are many ways to integrate a react project inside the common views and I'd like to know what's the best practice within the django community?

​

I don't want to move everything on react because just a small part of the project really need it and moving everything to react would mean an heavy rewriting.

/r/django
https://redd.it/ijvuz0
[D] Simple Questions Thread August 30, 2020

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/ijkivz
Tuesday megathread: 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 megathread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.**

/r/Python
https://redd.it/ik9o9r