I discovered context processors
Today I discovered context processors, basically I needed a variable to be globally accessible across all the templates, and wola Django has a built-in and elegant solution.
I love this tool so much!
/r/django
https://redd.it/1ghxoy8
Today I discovered context processors, basically I needed a variable to be globally accessible across all the templates, and wola Django has a built-in and elegant solution.
I love this tool so much!
/r/django
https://redd.it/1ghxoy8
Reddit
From the django community on Reddit
Explore this post and more from the django community
One thing about us developers is that we not business people so if you have experience working at a failed startup, what are some signs to look out for to see if you in a sinking ship?
As someone that has worked in a startup that did not do well. I think the signs were there when we client requests were inconsistent. We would serve a client there and there but there was no project that lasted a long time cause usually the service we provided would be complete in a month or 2. The company was funded to build a product so we can transition from providing a service to providing a Saas product but when the investors pulled out that's when it hit the fan that client work revenue was not enough to run a company and we were surviving off funding.
/r/django
https://redd.it/1ghzv3w
As someone that has worked in a startup that did not do well. I think the signs were there when we client requests were inconsistent. We would serve a client there and there but there was no project that lasted a long time cause usually the service we provided would be complete in a month or 2. The company was funded to build a product so we can transition from providing a service to providing a Saas product but when the investors pulled out that's when it hit the fan that client work revenue was not enough to run a company and we were surviving off funding.
/r/django
https://redd.it/1ghzv3w
Reddit
From the django community on Reddit
Explore this post and more from the django community
What would Enaml 2.0 look like? | nucleic/enaml | Declarative UI
From Enaml's docs:
> Enaml brings the declarative UI paradigm to Python in a seamlessly integrated fashion. The grammar of the Enaml language is a strict superset of Python. This means that any valid Python file is also a valid Enaml file, though the converse is not necessary true. The tight integration with Python means that the developer feels at home and uses standard Python syntax when expressing how their data models bind to the visual attributes of the UI.
> . . .
> Enaml’s declarative widgets provide a layer of abstraction on top of the widgets of a toolkit rendering library. Enaml ships with a backend based on Qt5/6 and third-party projects such as enaml-web and enaml-native provides alternative backends.
---
A maintainer of Enaml has just opened a brainstorm discussion on the next major development goals.
It's a project I've long admired, though rarely used, and I'd love to see it get some attention and a revamp. I think the bar these days has been raised by projects like QML and Slint, which provide a great context in which to set new goals.
/r/Python
https://redd.it/1gi2vwa
From Enaml's docs:
> Enaml brings the declarative UI paradigm to Python in a seamlessly integrated fashion. The grammar of the Enaml language is a strict superset of Python. This means that any valid Python file is also a valid Enaml file, though the converse is not necessary true. The tight integration with Python means that the developer feels at home and uses standard Python syntax when expressing how their data models bind to the visual attributes of the UI.
> . . .
> Enaml’s declarative widgets provide a layer of abstraction on top of the widgets of a toolkit rendering library. Enaml ships with a backend based on Qt5/6 and third-party projects such as enaml-web and enaml-native provides alternative backends.
---
A maintainer of Enaml has just opened a brainstorm discussion on the next major development goals.
It's a project I've long admired, though rarely used, and I'd love to see it get some attention and a revamp. I think the bar these days has been raised by projects like QML and Slint, which provide a great context in which to set new goals.
/r/Python
https://redd.it/1gi2vwa
GitHub
What would Enaml 2.0 look like? · nucleic/enaml · Discussion #558
Hi Everyone! I've been thinking lately that it might be time for me to devote some real effort into an Enaml version "2.0". I'd like some feedback from the community about that sh...
How to implement RBAC using Flask-Restful?
Hello Everyone
I am a newbie. I am using flask for a SaaS product for my company. Earlier I was using flask and custom decorators for Role Based Access Control(RBAC). But during code review they asked to change the API end points to Flask-Restful. So I am confused about this.
Thank You in advance.
/r/flask
https://redd.it/1gi2la3
Hello Everyone
I am a newbie. I am using flask for a SaaS product for my company. Earlier I was using flask and custom decorators for Role Based Access Control(RBAC). But during code review they asked to change the API end points to Flask-Restful. So I am confused about this.
Thank You in advance.
/r/flask
https://redd.it/1gi2la3
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Sunday Daily Thread: What's everyone working on this week?
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1gia4ox
# Weekly Thread: What's Everyone Working On This Week? 🛠️
Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
## How it Works:
1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.
## Guidelines:
Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.
## Example Shares:
1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
/r/Python
https://redd.it/1gia4ox
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Hello everyone I'm a beginner in django I took help of youtube to start my project of advance finance tracker but I'm lost as there are so many ways could you guys help me out
For my final year main project our group thought of doing django with data science but as I'm not a expert to be frank(I know only basics ) could you guys help me out 🙏 I'll be able to survive my last year
/r/django
https://redd.it/1gif0rw
For my final year main project our group thought of doing django with data science but as I'm not a expert to be frank(I know only basics ) could you guys help me out 🙏 I'll be able to survive my last year
/r/django
https://redd.it/1gif0rw
Reddit
From the django community on Reddit
Explore this post and more from the django community
Robyn finally supports OpenAPI/Swagger
Hey Everyone 👋
We just launched OpenAPI docs generation in Robyn. - https://github.com/sparckles/Robyn/releases/tag/v0.63.0
(For the unaware Robyn is a Super Fast Async Python Web Framework with a Rust runtime. )
It was one of our community's most requested features, and I hope you all will like it.
Do let us know what you think of it 😊
You can find the docs at - https://robyn.tech/documentation/api\_reference/openapi
/r/Python
https://redd.it/1gieai3
Hey Everyone 👋
We just launched OpenAPI docs generation in Robyn. - https://github.com/sparckles/Robyn/releases/tag/v0.63.0
(For the unaware Robyn is a Super Fast Async Python Web Framework with a Rust runtime. )
It was one of our community's most requested features, and I hope you all will like it.
Do let us know what you think of it 😊
You can find the docs at - https://robyn.tech/documentation/api\_reference/openapi
/r/Python
https://redd.it/1gieai3
GitHub
Release v0.63.0 - Introduce automatic OpenAPI docs generation · sparckles/Robyn
What's Changed
feat: openapi implementation by @VishnuSanal in #890
feat: introduce a disable openapi flag by @sansyrox in #929
feat: openapi response schema by @VishnuSanal in #932
fix: opena...
feat: openapi implementation by @VishnuSanal in #890
feat: introduce a disable openapi flag by @sansyrox in #929
feat: openapi response schema by @VishnuSanal in #932
fix: opena...
Python Institute Certs: Automation Track = Networking?
Hi there,
found that there is an automation certification track including the certs PCEA and PCAA at the Python Institute. Supposedly appearing in 2024.
https://pythoninstitute.org/certification-tracks
However, in the list that precedes the infographic, it is the python for networking track (certs PCEN and PCAN) that is mentioned next to the other tracks such as general programming etc.
Does anyone happen to know whether these are going to be the same certs/ merged?
In the sense of network automation? The different letters suggest they are different, but I’m confused why one appears in the list and the other one in the infographic.
/r/Python
https://redd.it/1gigwbg
Hi there,
found that there is an automation certification track including the certs PCEA and PCAA at the Python Institute. Supposedly appearing in 2024.
https://pythoninstitute.org/certification-tracks
However, in the list that precedes the infographic, it is the python for networking track (certs PCEN and PCAN) that is mentioned next to the other tracks such as general programming etc.
Does anyone happen to know whether these are going to be the same certs/ merged?
In the sense of network automation? The different letters suggest they are different, but I’m confused why one appears in the list and the other one in the infographic.
/r/Python
https://redd.it/1gigwbg
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How Do You Know When Your Project Idea is The One?
I’m curious about how other developers decide when a project idea is worth fully committing to. You know, that moment where you think, “This is it. This could be big,” and feel driven to go all-in and working on it nonstop.
For those who have had that experience how did you know this was the idea? Was it a response you got from potential users, or maybe just a gut feeling? And if you did go all in, how did it go?
I’m working on some ideas of my own and trying to figure out when to know if one of them has real potential. I’d love to hear your stories and any advice you might have.
/r/djangolearning
https://redd.it/1gif6o1
I’m curious about how other developers decide when a project idea is worth fully committing to. You know, that moment where you think, “This is it. This could be big,” and feel driven to go all-in and working on it nonstop.
For those who have had that experience how did you know this was the idea? Was it a response you got from potential users, or maybe just a gut feeling? And if you did go all in, how did it go?
I’m working on some ideas of my own and trying to figure out when to know if one of them has real potential. I’d love to hear your stories and any advice you might have.
/r/djangolearning
https://redd.it/1gif6o1
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
What features are missing in Django?
1. What features are missing in Django?
2. Are you happy with the current state of Django?
/r/django
https://redd.it/1gijjyw
1. What features are missing in Django?
2. Are you happy with the current state of Django?
/r/django
https://redd.it/1gijjyw
Reddit
From the django community on Reddit
Explore this post and more from the django community
A selfhosted web app built with plain Python
### What My Project Does
- Code: https://github.com/daya0576/beaverhabits/
- Demo: https://beaverhabits.com/demo/
When switching from Android to iOS, I was unable to find a light-weighted but handy habit tracking app, so I decided to make one by myself :p
The project's name (Beaver Habit Tracker) came from a game called "Against the Storm" (which I spent over 200 hours, highly recommended). In the game, my favourite species is the beaver, hoping this web app works as a beaver to record ur precious moments in your fleeting life.
---
### How the Project was Developed
Inspired the idea of "web UIs with plain Python" from Three Python trends in 2023, I developed a web app with 100% pure Python <3
The app is powered by an out-of-the-box framework called NiceGUI (including Quasar, Tailwind CSS, FastAPI, ...).
Some thoughts to share after several months of development:
- Good things ✅
1. WebSocket based communication between client and server, works perfectly with Python asyncio
2. Light-weighted session based storage provided, out of the box to use
3. Plenty of UI components provided, straightforward and highly customizable
4. ...
- Disadvantages:
1. The framework NiceGUI follows a backend-first philosophy: It hadles everything on the server side -> network latency could
/r/Python
https://redd.it/1giizja
### What My Project Does
- Code: https://github.com/daya0576/beaverhabits/
- Demo: https://beaverhabits.com/demo/
When switching from Android to iOS, I was unable to find a light-weighted but handy habit tracking app, so I decided to make one by myself :p
The project's name (Beaver Habit Tracker) came from a game called "Against the Storm" (which I spent over 200 hours, highly recommended). In the game, my favourite species is the beaver, hoping this web app works as a beaver to record ur precious moments in your fleeting life.
---
### How the Project was Developed
Inspired the idea of "web UIs with plain Python" from Three Python trends in 2023, I developed a web app with 100% pure Python <3
The app is powered by an out-of-the-box framework called NiceGUI (including Quasar, Tailwind CSS, FastAPI, ...).
Some thoughts to share after several months of development:
- Good things ✅
1. WebSocket based communication between client and server, works perfectly with Python asyncio
2. Light-weighted session based storage provided, out of the box to use
3. Plenty of UI components provided, straightforward and highly customizable
4. ...
- Disadvantages:
1. The framework NiceGUI follows a backend-first philosophy: It hadles everything on the server side -> network latency could
/r/Python
https://redd.it/1giizja
GitHub
GitHub - daya0576/beaverhabits at selfh.st
A self-hosted habit tracking app without "Goals". Contribute to daya0576/beaverhabits development by creating an account on GitHub.
I Wrote a Guide to Simulation in Python with SimPy
Hi folks,
I wrote a guide on discrete-event simulation with SimPy, designed to give you a solid foundation in building simulations using Python. Kind of like the official documentation but on steroids.
I have used SimPy personally in my own career for over a decade, it was central in helping me build a pretty successful engineering career. My latest venture is teaching others all about it.
If you do get the guide, I’d really appreciate any feedback you have. Feel free to drop your thoughts here in the thread or DM me directly!
Here’s the link to get the guide: https://simulation.teachem.digital/free-simulation-in-python-guide
For full transparency, why do I ask for your email?
Well I’m working on a full course following on from my previous Udemy course on Python. This new course will be all about real-world modelling and simulation with SimPy, and I’d love to send you keep you in the loop via email. If you found the guide helpful you would might be interested in the course. That said, you’re completely free to hit “unsubscribe” after the guide arrives if you prefer.
/r/Python
https://redd.it/1gipp8a
Hi folks,
I wrote a guide on discrete-event simulation with SimPy, designed to give you a solid foundation in building simulations using Python. Kind of like the official documentation but on steroids.
I have used SimPy personally in my own career for over a decade, it was central in helping me build a pretty successful engineering career. My latest venture is teaching others all about it.
If you do get the guide, I’d really appreciate any feedback you have. Feel free to drop your thoughts here in the thread or DM me directly!
Here’s the link to get the guide: https://simulation.teachem.digital/free-simulation-in-python-guide
For full transparency, why do I ask for your email?
Well I’m working on a full course following on from my previous Udemy course on Python. This new course will be all about real-world modelling and simulation with SimPy, and I’d love to send you keep you in the loop via email. If you found the guide helpful you would might be interested in the course. That said, you’re completely free to hit “unsubscribe” after the guide arrives if you prefer.
/r/Python
https://redd.it/1gipp8a
Reddit
From the MechanicalEngineering community on Reddit: My 13 Year Non-Traditional MechE Career Journey: Going from £23k to over £200k…
Explore this post and more from the MechanicalEngineering community
Deploy Django to DigitalOcean Kubernetes
https://youtu.be/-md_6nmogNc
/r/django
https://redd.it/1gir6he
https://youtu.be/-md_6nmogNc
/r/django
https://redd.it/1gir6he
YouTube
Deploy Django to DigitalOcean Kubernetes
How to deploy a Django Celery project to DigitalOcean Kubernetes for a production grade environment.
Get $200 of free DigitalOcean credits https://bit.ly/3UzTEcU
Repos
https://github.com/doherty-labs/django-rest-api
https://github.com/doherty-labs/terraform…
Get $200 of free DigitalOcean credits https://bit.ly/3UzTEcU
Repos
https://github.com/doherty-labs/django-rest-api
https://github.com/doherty-labs/terraform…
Monday Daily Thread: Project ideas!
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Description**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Description**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Description**: Create a script that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1gj14rr
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Description**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Description**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Description**: Create a script that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1gj14rr
YouTube
Build & Integrate your own custom chatbot to a website (Python & JavaScript)
In this fun project you learn how to build a custom chatbot in Python and then integrate this to a website using Flask and JavaScript.
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
Build a Secure Transaction System with Django Rest Framework (DRF) - Step-by-Step Guide
https://youtu.be/81k2pj436wA
/r/djangolearning
https://redd.it/1gi8393
https://youtu.be/81k2pj436wA
/r/djangolearning
https://redd.it/1gi8393
YouTube
Build a Secure Transaction System with Django Rest Framework (DRF) - Step-by-Step Guide
Learn how to build a secure and efficient transaction system API with Django Rest Framework (DRF) in this comprehensive end-to-end project tutorial. Follow along as we cover everything from database models and API endpoints to security measures, payment integrations…
I am trying to create multiple forms with a max_entries = to the number of usernames in the db. I realize it would probably be simpler with javascript the problem is I don't know any javascript. What would be the best way to do this using fieldList?
How do I create multiple forms with a max\_entries = to the number of usernames in the db? Here is the code I am basing this on [https://prettyprinted.com/tutorials/how-to-use-fieldlist-in-flask-wtf/](https://prettyprinted.com/tutorials/how-to-use-fieldlist-in-flask-wtf/) I tried this version in [app.py](http://app.py)
Also I just want one of the forms filled out at a time.
class UsernameForms(FlaskForm):
usernames = FieldList(FormField(CreateUserForm), min_entries=0, max_entries=0)
I also tried this example with not having `max_entries` in [app.py](http://app.py)
class UsernameForms(FlaskForm):
usernames = FieldList(FormField(CreateUserForm), min_entries=0)
I got the above idea from chatgpt so I am not sure if it will even work.
Here is a simple working example.
Here is my example [app.py](http://app.py)
[https://pastebin.com/FSfjgDch](https://pastebin.com/FSfjgDch)
Also when I try to go `flash(number_of_usernames_in_db) I get 5 so that can't be the problem.`
Here is the templates folder content which contains the html files.
[https://pastebin.com/cmvvn28J](https://pastebin.com/cmvvn28J)
Here is requirements.txt.
blinker==1.8.2
click==8.1.7
colorama==0.4.6
Flask==3.0.3
Flask-Breadcrumbs==0.5.1
Flask-Login==0.6.3
flask-menu==1.0.1
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.2
greenlet==3.1.1
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==3.0.2
six==1.16.0
/r/flask
https://redd.it/1gj3tgl
How do I create multiple forms with a max\_entries = to the number of usernames in the db? Here is the code I am basing this on [https://prettyprinted.com/tutorials/how-to-use-fieldlist-in-flask-wtf/](https://prettyprinted.com/tutorials/how-to-use-fieldlist-in-flask-wtf/) I tried this version in [app.py](http://app.py)
Also I just want one of the forms filled out at a time.
class UsernameForms(FlaskForm):
usernames = FieldList(FormField(CreateUserForm), min_entries=0, max_entries=0)
I also tried this example with not having `max_entries` in [app.py](http://app.py)
class UsernameForms(FlaskForm):
usernames = FieldList(FormField(CreateUserForm), min_entries=0)
I got the above idea from chatgpt so I am not sure if it will even work.
Here is a simple working example.
Here is my example [app.py](http://app.py)
[https://pastebin.com/FSfjgDch](https://pastebin.com/FSfjgDch)
Also when I try to go `flash(number_of_usernames_in_db) I get 5 so that can't be the problem.`
Here is the templates folder content which contains the html files.
[https://pastebin.com/cmvvn28J](https://pastebin.com/cmvvn28J)
Here is requirements.txt.
blinker==1.8.2
click==8.1.7
colorama==0.4.6
Flask==3.0.3
Flask-Breadcrumbs==0.5.1
Flask-Login==0.6.3
flask-menu==1.0.1
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.2
greenlet==3.1.1
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==3.0.2
six==1.16.0
/r/flask
https://redd.it/1gj3tgl
Prettyprinted
How to Use FieldList in Flask-WTF
Learn how to use the FieldList class in Flask-WTF so you can how repeated copies of a nested form
in a larger form.
in a larger form.
Python Threading Tutorial: Basic to Advanced (Multithreading, Pool Executors, Daemon, Lock, Events)
Are you trying to make your code run faster? In this video, we will be taking a deep dive into python threads from basic to advanced concepts so that you can take advantage of parallelism and concurrency to speed up your program.
- Python Thread without join()
- Python Thread with join()
- Python Thread with Input Arguments
- Python Multithreading
- Python Daemon Threads
- Python Thread with Synchronization using Locks
- Python Thread Queue Communication between Threads
- Python Thread Pool Executor
- Python Thread Events
- Speed Comparison I/O Task
- Speed Comparison CPU Task (Multithreading vs Multiprocessing)
https://youtu.be/Rm9Pic2rpAQ
/r/Python
https://redd.it/1gj177a
Are you trying to make your code run faster? In this video, we will be taking a deep dive into python threads from basic to advanced concepts so that you can take advantage of parallelism and concurrency to speed up your program.
- Python Thread without join()
- Python Thread with join()
- Python Thread with Input Arguments
- Python Multithreading
- Python Daemon Threads
- Python Thread with Synchronization using Locks
- Python Thread Queue Communication between Threads
- Python Thread Pool Executor
- Python Thread Events
- Speed Comparison I/O Task
- Speed Comparison CPU Task (Multithreading vs Multiprocessing)
https://youtu.be/Rm9Pic2rpAQ
/r/Python
https://redd.it/1gj177a
YouTube
Python Threading Tutorial: Basic to Advanced (Multithreading, Pool Executors, Daemon, Lock, Events)
Are you trying to make your code run faster? In this video, we will be taking a deep dive into python threads from basic to advanced concepts so that you can take advantage of parallelism and concurrency to speed up your program.
0:00 Introduction
0:53…
0:00 Introduction
0:53…
Flask, Gunicorn, multiprocessing under the hood. Optimal number of workers?
I'm in the process of configuring my flask app, trying to find the optimal configuration for our use case.
We had a slow endpoint on our API, but with the implementation of multiprocessing we've managed to roughly 10x the performance of that particular task such that the speed is acceptable.
I deploy the image on a VM with 16 cores.
The multiprocessing uses all 16 cores.
The gunicorn documentation seems to recommend a configuration of (2*num_cores) + 1 workers.
I tried this configuration, but it seems to make the machine fall over. Is this becase multiple workers trying to access all the cores at the same time is a disaster?
The optimal configuration for my app seems to be simply 1 gunicorn worker. Then it has sole access to the 16 cores, and it can complete requests in a good amount of time and then move onto the next request.
Does this sound normal / expected?
I deploy to Azure and the error I kept seeing until I reduced the number of workers was something like 'rate limit: too many requests' even though it was only 10 simultaneous requests.
(on second thought, I think this rate limit is hitting a memory limit. When 2 requests come in, and attempt
/r/flask
https://redd.it/1gio20q
I'm in the process of configuring my flask app, trying to find the optimal configuration for our use case.
We had a slow endpoint on our API, but with the implementation of multiprocessing we've managed to roughly 10x the performance of that particular task such that the speed is acceptable.
I deploy the image on a VM with 16 cores.
The multiprocessing uses all 16 cores.
The gunicorn documentation seems to recommend a configuration of (2*num_cores) + 1 workers.
I tried this configuration, but it seems to make the machine fall over. Is this becase multiple workers trying to access all the cores at the same time is a disaster?
The optimal configuration for my app seems to be simply 1 gunicorn worker. Then it has sole access to the 16 cores, and it can complete requests in a good amount of time and then move onto the next request.
Does this sound normal / expected?
I deploy to Azure and the error I kept seeing until I reduced the number of workers was something like 'rate limit: too many requests' even though it was only 10 simultaneous requests.
(on second thought, I think this rate limit is hitting a memory limit. When 2 requests come in, and attempt
/r/flask
https://redd.it/1gio20q
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Why Django
Why would you pick Django over other similar frameworks such Laravel, Ruby on Rails, Phoenix, Adonis, etc?
I hear lots of people say Django very rarely has breaking changes - do you stand by that?
/r/django
https://redd.it/1gj46hc
Why would you pick Django over other similar frameworks such Laravel, Ruby on Rails, Phoenix, Adonis, etc?
I hear lots of people say Django very rarely has breaking changes - do you stand by that?
/r/django
https://redd.it/1gj46hc
Reddit
From the django community on Reddit
Explore this post and more from the django community