Tuesday Daily Thread: Advanced questions
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1gp7a3y
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1gp7a3y
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. | 412982 members
Impressed by Django
Working in big tech and using Java, Django is a fresh breath of air. What are your favorite features of Django? I’m currently really liking Django Admin. I like the batteries included approach. I’m also glad to be out of pom.xml hell. While virtual environments are a bit annoying it’s overall easier to grok what’s going on with Python. I’m also impressed by Bulma. I like that I don’t have to use JavaScript to build a functioning UI. Something I still get a bit confused about is how to separate things out into apps. It’s tempting to just keep everything in one app as one big monolith. I think I’ll get better at that when I am more experienced with Django.
/r/django
https://redd.it/1gp90la
Working in big tech and using Java, Django is a fresh breath of air. What are your favorite features of Django? I’m currently really liking Django Admin. I like the batteries included approach. I’m also glad to be out of pom.xml hell. While virtual environments are a bit annoying it’s overall easier to grok what’s going on with Python. I’m also impressed by Bulma. I like that I don’t have to use JavaScript to build a functioning UI. Something I still get a bit confused about is how to separate things out into apps. It’s tempting to just keep everything in one app as one big monolith. I think I’ll get better at that when I am more experienced with Django.
/r/django
https://redd.it/1gp90la
Reddit
From the django community on Reddit
Explore this post and more from the django community
A complete-ish guide to dependency management in Python
I recently wrote a very long blog post about dependency management in Python. You can read it here:
https://nielscautaerts.xyz/python-dependency-management-is-a-dumpster-fire.html
Why I wrote this
Anecdotally, it seems that very few people who write Python - even professionally - think seriously about dependencies. Part of that has to do with the tooling, but part of it has to do with a knowledge gap. That is a problem, because most Python projects have a lot of dependencies, and you can very quickly make a mess if you don't have a strategy to manage them. You have to think about dependencies if you want to build and maintain a serious Python project that you can collaborate on with multiple people and that you can deploy fearlessly. Initially I wrote this for my colleagues, but I'm sharing it here in case more people find it useful.
What it's about
In the post, I go over what good dependency management is, why it is important, and why I believe it's hard to do well in Python. I then survey the tooling landscape (from the built in tools like pip and venv to the newest tools like uv and pixi) for creating reproducible environments, comparing advantages and disadvantages. Finally I give some
/r/Python
https://redd.it/1gphzn2
I recently wrote a very long blog post about dependency management in Python. You can read it here:
https://nielscautaerts.xyz/python-dependency-management-is-a-dumpster-fire.html
Why I wrote this
Anecdotally, it seems that very few people who write Python - even professionally - think seriously about dependencies. Part of that has to do with the tooling, but part of it has to do with a knowledge gap. That is a problem, because most Python projects have a lot of dependencies, and you can very quickly make a mess if you don't have a strategy to manage them. You have to think about dependencies if you want to build and maintain a serious Python project that you can collaborate on with multiple people and that you can deploy fearlessly. Initially I wrote this for my colleagues, but I'm sharing it here in case more people find it useful.
What it's about
In the post, I go over what good dependency management is, why it is important, and why I believe it's hard to do well in Python. I then survey the tooling landscape (from the built in tools like pip and venv to the newest tools like uv and pixi) for creating reproducible environments, comparing advantages and disadvantages. Finally I give some
/r/Python
https://redd.it/1gphzn2
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Django Monolith or Backend w/ DRF
In your industry facing projects or workplace, in which cases you have used Django SSR (templates for frontend) and in which cases you have used Django for backend only (used drf/ninja for api building) with a React/Vue framework for frontend?
/r/django
https://redd.it/1gpjhbw
In your industry facing projects or workplace, in which cases you have used Django SSR (templates for frontend) and in which cases you have used Django for backend only (used drf/ninja for api building) with a React/Vue framework for frontend?
/r/django
https://redd.it/1gpjhbw
Reddit
From the django community on Reddit
Explore this post and more from the django community
Waiting for Geopolars
I have been using polars for the past few months and love it so much. So much faster and cleaner than pandas. I am about to start a new personal project that will use a lot of geo-dataframes and am thinking about which package to use. Geo pandas exists but its slow and I'd rather something more up to date and polars compatible.
After doing some digging, Geopolars is well on the way but still a major work in progress, several months away from an alpha at least. I'd contribute but my rust isn't up to scratch. I think I might just have to use geopandas for now and convert my code to geopolars when it comes out. Anyone have any thoughts on this?
/r/Python
https://redd.it/1gpkev1
I have been using polars for the past few months and love it so much. So much faster and cleaner than pandas. I am about to start a new personal project that will use a lot of geo-dataframes and am thinking about which package to use. Geo pandas exists but its slow and I'd rather something more up to date and polars compatible.
After doing some digging, Geopolars is well on the way but still a major work in progress, several months away from an alpha at least. I'd contribute but my rust isn't up to scratch. I think I might just have to use geopandas for now and convert my code to geopolars when it comes out. Anyone have any thoughts on this?
/r/Python
https://redd.it/1gpkev1
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Python for R users
I've been writing primarily R code for nearly 20 years but recently needed to get back into Python for several maintenance and development projects. I put together a set of resources for getting up to speed in Python as an experienced R developer.
https://blog.stephenturner.us/p/python-for-r-users
/r/Python
https://redd.it/1gpqqox
I've been writing primarily R code for nearly 20 years but recently needed to get back into Python for several maintenance and development projects. I put together a set of resources for getting up to speed in Python as an experienced R developer.
https://blog.stephenturner.us/p/python-for-r-users
/r/Python
https://redd.it/1gpqqox
blog.stephenturner.us
Python for R users
A Google search for “R vs Python” returns thousands of hits across sites like Reddit, IBM, Datacamp, Coursera, Kaggle, and many others.
D What makes a good PhD student in ML
Hey as I started my PhD (topic: Interpretable Object Detection) recently I would be really curious to know what set of features you think make a successfull PhD student
/r/MachineLearning
https://redd.it/1gplmzb
Hey as I started my PhD (topic: Interpretable Object Detection) recently I would be really curious to know what set of features you think make a successfull PhD student
/r/MachineLearning
https://redd.it/1gplmzb
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
pyinapp_purchase: Verify In-app Purchase
Hi, [pyinapp\_purchase](https://github.com/Michael-Jalloh/pyinapp_purchase) is a simple python library to helps to verify,consume and acknowledge in-app purchase with just the purchase token. Currently on supports google but apple verification is coming soon.
**What does it do:**
* Seamless Integration: Quickly integrate the validator into existing Python applications.
* Verification: Handles token verification directly with the Google Play Store API to ensure data authenticity.
* Consumption: Handles token consumption if token wasn't consume client side.
* Acknowledgement: Handles token acknowledgement.
* Error Handling: Provides clear feedback for successful or failed token validations.
* Lightweight and Performant: Minimal dependencies and optimized for fast, reliable performance.
**Target Audience?**
* Its for backend developers working on mobile application, looking for ways to verify purchase done on their mobile app.
* For backend developers looking to track purchases on their backend.
**Comparison?**
* **pyinapp**: it used receipt instead of purchase token
* **inapp-purchases**: Last update 2018, [pyinapp\_purchase](https://github.com/Michael-Jalloh/pyinapp_purchase) uses new apis
/r/Python
https://redd.it/1gphajd
Hi, [pyinapp\_purchase](https://github.com/Michael-Jalloh/pyinapp_purchase) is a simple python library to helps to verify,consume and acknowledge in-app purchase with just the purchase token. Currently on supports google but apple verification is coming soon.
**What does it do:**
* Seamless Integration: Quickly integrate the validator into existing Python applications.
* Verification: Handles token verification directly with the Google Play Store API to ensure data authenticity.
* Consumption: Handles token consumption if token wasn't consume client side.
* Acknowledgement: Handles token acknowledgement.
* Error Handling: Provides clear feedback for successful or failed token validations.
* Lightweight and Performant: Minimal dependencies and optimized for fast, reliable performance.
**Target Audience?**
* Its for backend developers working on mobile application, looking for ways to verify purchase done on their mobile app.
* For backend developers looking to track purchases on their backend.
**Comparison?**
* **pyinapp**: it used receipt instead of purchase token
* **inapp-purchases**: Last update 2018, [pyinapp\_purchase](https://github.com/Michael-Jalloh/pyinapp_purchase) uses new apis
/r/Python
https://redd.it/1gphajd
GitHub
GitHub - Michael-Jalloh/pyinapp_purchase: pyinapp_purchase is an open-source Python library designed to simplify and securely validate…
pyinapp_purchase is an open-source Python library designed to simplify and securely validate in-app purchase tokens server side. - Michael-Jalloh/pyinapp_purchase
Sending cross-email-client-compatible emails with MJML and Python
Email clients, even Gmail opened in a browser have limited and varying support for HTML/CSS which makes sending good-looking emails hard, especially for various older Outlook clients and other popular email apps.
The old way was tedious inbox testing, conditional Outlook HTML code with tables inside tables and so on. Python could use premailer to inline styles for much better compatibility of plain HTML/CSS and then use tidy to clear HTML from any excess markup and errors... but it's not perfect and limited.
We got React Email some time ago, but it's React. Then one of email marketing companies, Mailjet, got triggered enough that they made a sort of a standard/markup - MJML \- set that is email message-safe and can be used in browser WYSIWYG as well as backend parsers. Python has an unofficial library so it's very easy to quickly switch to using MJML for email templates.
Aside from client compatibility there is the issue of sending emails so they don't go into spam folder, that will display nicely even if the client blocked loading external assets and more... I went through those problems and some solutions in my tutorial:
Tutorial Link: [https://rkblog.dev/posts/python/sending-good-looking-mjml-emails-with-python/](https://rkblog.dev/posts/python/sending-good-looking-mjml-emails-with-python/)
MJML live editor: https://mjml.io/try-it-live
/r/Python
https://redd.it/1gpus46
Email clients, even Gmail opened in a browser have limited and varying support for HTML/CSS which makes sending good-looking emails hard, especially for various older Outlook clients and other popular email apps.
The old way was tedious inbox testing, conditional Outlook HTML code with tables inside tables and so on. Python could use premailer to inline styles for much better compatibility of plain HTML/CSS and then use tidy to clear HTML from any excess markup and errors... but it's not perfect and limited.
We got React Email some time ago, but it's React. Then one of email marketing companies, Mailjet, got triggered enough that they made a sort of a standard/markup - MJML \- set that is email message-safe and can be used in browser WYSIWYG as well as backend parsers. Python has an unofficial library so it's very easy to quickly switch to using MJML for email templates.
Aside from client compatibility there is the issue of sending emails so they don't go into spam folder, that will display nicely even if the client blocked loading external assets and more... I went through those problems and some solutions in my tutorial:
Tutorial Link: [https://rkblog.dev/posts/python/sending-good-looking-mjml-emails-with-python/](https://rkblog.dev/posts/python/sending-good-looking-mjml-emails-with-python/)
MJML live editor: https://mjml.io/try-it-live
/r/Python
https://redd.it/1gpus46
RkBlog
Sending cross-email-client-compatible emails with MJML and Python
Sending a good-looking email is not easy due to limited and varying HTML support by email clients. MJML can however help with this problem.
I am willing to work on a volunteering basis to gain more experience and grow
Hey everyone,
I’m looking for opportunities to volunteer and contribute as a developer. I have solid experience with backend development in Django, along with the skills needed to build full systems and integrate frontend components. I also have some exposure to DevOps and am actively expanding my knowledge in that area.
In my recent experience, I worked as a full-stack intern for 1.5 months, handling tasks across backend, frontend, and documentation. Although it was an unpaid role, I gained hands-on experience working on real projects, and now I’m eager to find a paid position. However, I’m open to volunteer for a meaningful role where I can grow, contribute, and help build impactful projects.
I’m willing to put in up to 12 hours a day if needed. If anyone has any openings or knows of any projects that could benefit from my skills, please let me know. Thanks!
/r/djangolearning
https://redd.it/1gok8jy
Hey everyone,
I’m looking for opportunities to volunteer and contribute as a developer. I have solid experience with backend development in Django, along with the skills needed to build full systems and integrate frontend components. I also have some exposure to DevOps and am actively expanding my knowledge in that area.
In my recent experience, I worked as a full-stack intern for 1.5 months, handling tasks across backend, frontend, and documentation. Although it was an unpaid role, I gained hands-on experience working on real projects, and now I’m eager to find a paid position. However, I’m open to volunteer for a meaningful role where I can grow, contribute, and help build impactful projects.
I’m willing to put in up to 12 hours a day if needed. If anyone has any openings or knows of any projects that could benefit from my skills, please let me know. Thanks!
/r/djangolearning
https://redd.it/1gok8jy
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
How to move images from one ImageField to another?
Here's the problem:
I have a User model, that accepts 3 images (img\_one, img\_two, and img\_three).
Then I have a view, that lets me delete an image, and then "rebalance them". For example if I have 3 images, and delete the second one, the img\_three data should move to img\_two.
And I can't seem to figure out how to do this "rebalancing part" correctly.
Here's the code for views.py:
@login_required
def img_delete_action(request, img_id):
if request.method == 'POST':
if img_id == 1 and request.user.img_one:
request.user.img_one.delete()
elif img_id == 2 and request.user.img_two:
request.user.img_two.delete()
elif img_id == 3 and request.user.img_three:
request.user.img_three.delete()
else:
return render(request, "components/user-images.html")
img_list = [request.user.img_one, request.user.img_two, request.user.img_three]
rebalanced_list = []
/r/django
https://redd.it/1gpvp52
Here's the problem:
I have a User model, that accepts 3 images (img\_one, img\_two, and img\_three).
Then I have a view, that lets me delete an image, and then "rebalance them". For example if I have 3 images, and delete the second one, the img\_three data should move to img\_two.
And I can't seem to figure out how to do this "rebalancing part" correctly.
Here's the code for views.py:
@login_required
def img_delete_action(request, img_id):
if request.method == 'POST':
if img_id == 1 and request.user.img_one:
request.user.img_one.delete()
elif img_id == 2 and request.user.img_two:
request.user.img_two.delete()
elif img_id == 3 and request.user.img_three:
request.user.img_three.delete()
else:
return render(request, "components/user-images.html")
img_list = [request.user.img_one, request.user.img_two, request.user.img_three]
rebalanced_list = []
/r/django
https://redd.it/1gpvp52
Reddit
From the django community on Reddit
Explore this post and more from the django community
Displaying human readable choice from a field in a template from a form
this took an incredible amount of time to work through all the kinks and I'm wondering if there was an easier way to do this. I created a form for a profile model to be used for a dating site so a lot of the fields have a list of choices for the possible values. trying to get the human readable values from the choices lists was a challenge since the form will always send the short notation of the choice. even trying to set the default response from the model as the get_FOO display value wasn't working through the template, so i created a template tag that can be called from the template to convert into the display values and went from there. It presented it's own challenges as now the values had to be attained ising the get_field_display method, there was no more if form.status == 2 in my templates it had to be form.instance|get_field_display:'<field name>' and if i wanted to check for null values |default:'' had to be added to the end to force the template to correctly distinguish if a value was null or not. I wanted to show how i was able to get it
/r/django
https://redd.it/1gq4swc
this took an incredible amount of time to work through all the kinks and I'm wondering if there was an easier way to do this. I created a form for a profile model to be used for a dating site so a lot of the fields have a list of choices for the possible values. trying to get the human readable values from the choices lists was a challenge since the form will always send the short notation of the choice. even trying to set the default response from the model as the get_FOO display value wasn't working through the template, so i created a template tag that can be called from the template to convert into the display values and went from there. It presented it's own challenges as now the values had to be attained ising the get_field_display method, there was no more if form.status == 2 in my templates it had to be form.instance|get_field_display:'<field name>' and if i wanted to check for null values |default:'' had to be added to the end to force the template to correctly distinguish if a value was null or not. I wanted to show how i was able to get it
/r/django
https://redd.it/1gq4swc
Reddit
From the django community on Reddit
Explore this post and more from the django community
Wednesday Daily Thread: Beginner questions
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1gpzgm9
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1gpzgm9
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. | 412982 members
help with flask
hello everyone, I don't know much about programming but I'm developing an urban farm application in Flask for my college graduation. Since I don't know much about it, I used AI to help me make everything work correctly, but after everything was ready I realized that the code was not object-oriented, which is a main requirement of my work, so I would like to ask if anyone has free time to take a look at my code and give me guidance on how to make it object-oriented in the simplest way possible. I would be grateful for the help. Thanks
/r/flask
https://redd.it/1gpc81y
hello everyone, I don't know much about programming but I'm developing an urban farm application in Flask for my college graduation. Since I don't know much about it, I used AI to help me make everything work correctly, but after everything was ready I realized that the code was not object-oriented, which is a main requirement of my work, so I would like to ask if anyone has free time to take a look at my code and give me guidance on how to make it object-oriented in the simplest way possible. I would be grateful for the help. Thanks
/r/flask
https://redd.it/1gpc81y
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Excel Workbook Refresh Automation
Hey everyone! I’m looking to automate a repetitive task with Python and could use some help. I have a folder full of Excel workbooks that contain queries (linked to an ODBC connection), and I need a program that will:
1. Open each Excel file in the folder one by one.
2. Hit Control + Shift + F5 to refresh all queries in each workbook.
3. Wait until all the queries are done refreshing.
4. Save the workbook.
5. Close it and move to the next file.
Does anyone have suggestions on how to make this happen? I’d appreciate any code snippets or libraries to look into—thanks!
/r/Python
https://redd.it/1gq4aum
Hey everyone! I’m looking to automate a repetitive task with Python and could use some help. I have a folder full of Excel workbooks that contain queries (linked to an ODBC connection), and I need a program that will:
1. Open each Excel file in the folder one by one.
2. Hit Control + Shift + F5 to refresh all queries in each workbook.
3. Wait until all the queries are done refreshing.
4. Save the workbook.
5. Close it and move to the next file.
Does anyone have suggestions on how to make this happen? I’d appreciate any code snippets or libraries to look into—thanks!
/r/Python
https://redd.it/1gq4aum
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
The Mill build tool is looking for people to collaborate with on adding Python support
Hi All,
Mill is a build tool traditionally targeting JVM languages Java/Scala/Kotlin, but is branching out to support other languages like multi-module Python or Javascript codebases. We're looking for people interested build tools to collaborate with us on adding first-class Python toolchain support to Mill. To that end, we've put up a non-trivial issue bounty to encourage collaboration for anyone who implements various Python-related build examples and tooling integrations for Mill:
First Class Python Support (4000USD Bounty)
I'd love to get feedback on the tool, the Python support roadmap, or thoughts on what people need from a Python build tool. My own Python tooling experience is a bit out of date, so any feedback (both positive or negative) would be very welcome!
/r/Python
https://redd.it/1gq6d3e
Hi All,
Mill is a build tool traditionally targeting JVM languages Java/Scala/Kotlin, but is branching out to support other languages like multi-module Python or Javascript codebases. We're looking for people interested build tools to collaborate with us on adding first-class Python toolchain support to Mill. To that end, we've put up a non-trivial issue bounty to encourage collaboration for anyone who implements various Python-related build examples and tooling integrations for Mill:
First Class Python Support (4000USD Bounty)
I'd love to get feedback on the tool, the Python support roadmap, or thoughts on what people need from a Python build tool. My own Python tooling experience is a bit out of date, so any feedback (both positive or negative) would be very welcome!
/r/Python
https://redd.it/1gq6d3e
GitHub
First Class Python Support (??? Bounty) · Issue #3928 · com-lihaoyi/mill
Python is common in industry, and lacks good build tools. Bazel works but is ferociously complicated. Pants2 tried to be "the" python build system and failed. Could be worth giving it a s...
Building efficient API in Django REST framework, Django-ninja, and comparing to Golang
A few days ago I wrote about a step-by-step guide in optimizing an API written in Django REST Framework for retrieving large amount data (100k+ records), and most Redditors here liked it.
I have now added the same example written with Django-ninja to compare. Just for fun I also added a very light weight Golang implementation of the identical API.
https://preview.redd.it/11phws0hpl0e1.png?width=600&format=png&auto=webp&s=b34cf1b2c6fbb2ca16760431b4890954c55a4049
https://preview.redd.it/sugub4hipl0e1.png?width=600&format=png&auto=webp&s=b0aa484e8c57728f8b375a0e8d7902464dda2de7
One thing that was surprising to me is that Django-ninja does not appear to be using more memory than the Go implementation.
You check out the updated implementations and the test results here: https://github.com/oscarychen/building-efficient-api
/r/django
https://redd.it/1gq5efh
A few days ago I wrote about a step-by-step guide in optimizing an API written in Django REST Framework for retrieving large amount data (100k+ records), and most Redditors here liked it.
I have now added the same example written with Django-ninja to compare. Just for fun I also added a very light weight Golang implementation of the identical API.
https://preview.redd.it/11phws0hpl0e1.png?width=600&format=png&auto=webp&s=b34cf1b2c6fbb2ca16760431b4890954c55a4049
https://preview.redd.it/sugub4hipl0e1.png?width=600&format=png&auto=webp&s=b0aa484e8c57728f8b375a0e8d7902464dda2de7
One thing that was surprising to me is that Django-ninja does not appear to be using more memory than the Go implementation.
You check out the updated implementations and the test results here: https://github.com/oscarychen/building-efficient-api
/r/django
https://redd.it/1gq5efh
Question for the pros
Hi coders!
I've been made redundant, and so l've decided to take up a new challenge - Python.
Currently reading through: Automate the boring stuff with python by Al Sweigart. ChatGPT recommended this beginners guide as its top choice.
Any tips you could impart on someone getting into the topic? Things you wished you knew at an early stage?
/r/Python
https://redd.it/1gq9qe2
Hi coders!
I've been made redundant, and so l've decided to take up a new challenge - Python.
Currently reading through: Automate the boring stuff with python by Al Sweigart. ChatGPT recommended this beginners guide as its top choice.
Any tips you could impart on someone getting into the topic? Things you wished you knew at an early stage?
/r/Python
https://redd.it/1gq9qe2
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Question about libraries
I don't understand how I should learn libraries. Let me explain: reading them I often don't understand what is written, it's all so difficult and technical. So I think "maybe I should watch an introductory video?" but I don't do it because it seems ethically wrong, I think I should learn by myself and not relying on someone's help every time. Can you tell me how you understand a library? Or a set of libraries needed to create a type of application (even more difficult since I don't even know which library to start with).
/r/Python
https://redd.it/1gq8qj3
I don't understand how I should learn libraries. Let me explain: reading them I often don't understand what is written, it's all so difficult and technical. So I think "maybe I should watch an introductory video?" but I don't do it because it seems ethically wrong, I think I should learn by myself and not relying on someone's help every time. Can you tell me how you understand a library? Or a set of libraries needed to create a type of application (even more difficult since I don't even know which library to start with).
/r/Python
https://redd.it/1gq8qj3
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How can I implement email verification in Django?
https://stackoverflow.com/questions/79182908/how-can-i-implement-email-verification-in-django
/r/djangolearning
https://redd.it/1gq3sdm
https://stackoverflow.com/questions/79182908/how-can-i-implement-email-verification-in-django
/r/djangolearning
https://redd.it/1gq3sdm
Stack Overflow
How can I implement email verification in Django
Completely stumped! I'm using the console as my email backend. I end up with False in token_generator.check_token as a result "Invalid or expired token." is displayed in my homepage when I