Django Ninja vs DRF for Async ? Seeking Advice
Hey everyone,
We’re building an API for our app, and while we really want to use Django, we need robust async capabilities since we’ll be making external API requests (e.g., OpenAI, LLMs).
We’re torn between Django REST Framework (DRF) and Django Ninja. While Django Ninja supports async out of the box and looks very developer-friendly, we’re concerned about its long-term support and community size compared to DRF. Future-proofing our app is important since this API will be a core part of our project.
For those who have used Django Ninja in production, would you recommend it? What are your experiences with its stability and scalability?
If not Django Ninja, how would you approach incorporating async functionality into a DRF-based API? Any advice or recommendations would be greatly appreciated! We will definitely use Celery for some tasks but rn we're looking for a solution for immediate responses.
Thanks in advance! 🙏
P.S. We also need robust permission handling since we need to be HIPAA compliant.
/r/django
https://redd.it/1i9f9bb
Hey everyone,
We’re building an API for our app, and while we really want to use Django, we need robust async capabilities since we’ll be making external API requests (e.g., OpenAI, LLMs).
We’re torn between Django REST Framework (DRF) and Django Ninja. While Django Ninja supports async out of the box and looks very developer-friendly, we’re concerned about its long-term support and community size compared to DRF. Future-proofing our app is important since this API will be a core part of our project.
For those who have used Django Ninja in production, would you recommend it? What are your experiences with its stability and scalability?
If not Django Ninja, how would you approach incorporating async functionality into a DRF-based API? Any advice or recommendations would be greatly appreciated! We will definitely use Celery for some tasks but rn we're looking for a solution for immediate responses.
Thanks in advance! 🙏
P.S. We also need robust permission handling since we need to be HIPAA compliant.
/r/django
https://redd.it/1i9f9bb
Reddit
From the django community on Reddit
Explore this post and more from the django community
For my Textual users! Neovim plugin to support Textual CSS Syntax Highlighting
Here's the GitHub repo
Added support for all the same rules as seen in the VSCode Extension for Textual CSS. Hope it's of use to anyone!
/r/Python
https://redd.it/1i9stwk
Here's the GitHub repo
Added support for all the same rules as seen in the VSCode Extension for Textual CSS. Hope it's of use to anyone!
/r/Python
https://redd.it/1i9stwk
GitHub
GitHub - cachebag/nvim-tcss: A Neovim plugin for Textual CSS (.tcss) syntax highlighting as seen on www.github.com/Textualize/transcendent…
A Neovim plugin for Textual CSS (.tcss) syntax highlighting as seen on www.github.com/Textualize/transcendent-textual - cachebag/nvim-tcss
Understanding .get vs get_object_or_404 in Django
https://www.youtube.com/watch?v=J7r5K5kLGWY&t=281s
/r/django
https://redd.it/1i9xvlm
https://www.youtube.com/watch?v=J7r5K5kLGWY&t=281s
/r/django
https://redd.it/1i9xvlm
YouTube
Understanding .get vs get_object_or_404 in Django | How To Use get_object_or_404 In Django
In this video, I will break down the difference between .get() and get_object_or_404() in Django. Learn when to use each, how they handle missing objects, and why get_object_or_404 is a lifesaver for clean and error-proof code! Perfect for Django beginners…
Help Needed: Unable to Update Field Values in Web App (304 Not Modified Issue)
Hi All,
Hi everyone,
I'm working on a small project involving web application development. While I can successfully create records for users, I'm running into trouble updating field values. Every time I try to update, I encounter a
I suspect there's something wrong in my code or configuration, but I can't pinpoint the exact issue.
Here’s what I’d like help with:
Understanding why I might be receiving a `304 Not Modified` status.
Identifying the part of the code I should focus on (frontend or backend).
Below is a brief overview of the technologies I’m using and relevant details:
Frontend: \[HTML, CSS, JavaSCript\]
Backend: [Python\]
Database: \[SQLAlchemy, MySQL\]
HTTP Method for Update: POST, GET
Error Details:
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/css/style.css HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/profile\_details.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/images/default_placeholder.png HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/calendar\_availability.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:23\] "GET /static/css/style.css HTTP/1.1" 304 -
I’d appreciate any guidance or suggestions. If needed, I can share snippets of the relevant code. Thank you in
/r/flask
https://redd.it/1i9uqpw
Hi All,
Hi everyone,
I'm working on a small project involving web application development. While I can successfully create records for users, I'm running into trouble updating field values. Every time I try to update, I encounter a
304 Not Modified status response.I suspect there's something wrong in my code or configuration, but I can't pinpoint the exact issue.
Here’s what I’d like help with:
Understanding why I might be receiving a `304 Not Modified` status.
Identifying the part of the code I should focus on (frontend or backend).
Below is a brief overview of the technologies I’m using and relevant details:
Frontend: \[HTML, CSS, JavaSCript\]
Backend: [Python\]
Database: \[SQLAlchemy, MySQL\]
HTTP Method for Update: POST, GET
Error Details:
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/css/style.css HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/profile\_details.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/images/default_placeholder.png HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/calendar\_availability.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:23\] "GET /static/css/style.css HTTP/1.1" 304 -
I’d appreciate any guidance or suggestions. If needed, I can share snippets of the relevant code. Thank you in
/r/flask
https://redd.it/1i9uqpw
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Possibility of Django being helpful to land a job
Hey guys I am an aspiring software engineer who has made and launched a live website using Django. I really like Django but I don’t see that many career opportunities that Django can give me, so I am thinking if I should focus on data science/analytics. What are your honest thoughts about this?
/r/django
https://redd.it/1ia5gbk
Hey guys I am an aspiring software engineer who has made and launched a live website using Django. I really like Django but I don’t see that many career opportunities that Django can give me, so I am thinking if I should focus on data science/analytics. What are your honest thoughts about this?
/r/django
https://redd.it/1ia5gbk
Reddit
From the django community on Reddit
Explore this post and more from the django 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/1ia0tm7
# 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/1ia0tm7
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
A technical intro to Ibis: The portable Python DataFrame library
We recently explored Ibis, a Python library designed to simplify working with data across multiple storage systems and processing engines. It provides a DataFrame-like API, similar to Pandas, but translates Python operations into backend-specific queries. This allows it to work with SQL databases, analytical engines like BigQuery and DuckDB, and even in-memory tools like Pandas. By acting as a middle layer, Ibis addresses challenges like fragmented storage, scalability, and redundant logic, enabling a more consistent and efficient approach to multi-backend data workflows. Wrote up some learnings here: https://blog.structuredlabs.com/p/a-technical-intro-to-ibis-the-portable?r=4pzohi&utm\_campaign=post&utm\_medium=web&showWelcomeOnShare=false
/r/Python
https://redd.it/1ia1gjx
We recently explored Ibis, a Python library designed to simplify working with data across multiple storage systems and processing engines. It provides a DataFrame-like API, similar to Pandas, but translates Python operations into backend-specific queries. This allows it to work with SQL databases, analytical engines like BigQuery and DuckDB, and even in-memory tools like Pandas. By acting as a middle layer, Ibis addresses challenges like fragmented storage, scalability, and redundant logic, enabling a more consistent and efficient approach to multi-backend data workflows. Wrote up some learnings here: https://blog.structuredlabs.com/p/a-technical-intro-to-ibis-the-portable?r=4pzohi&utm\_campaign=post&utm\_medium=web&showWelcomeOnShare=false
/r/Python
https://redd.it/1ia1gjx
Structuredlabs
A technical intro to Ibis: The portable Python DataFrame library
How Ibis simplifies analytics across multi-backend systems with a unified Python API
Currex - Pythonic currency calculator with exchange rates
Repo: [https://github.com/stared/currex](https://github.com/stared/currex)
Demo: [try in Google Colab without installing anything](https://colab.research.google.com/github/stared/currex/blob/main/currex.ipynb)
I often use Python as a command-line calculator. However, I frequently found myself going back to Google Search to convert between currencies. So, I created this library to make adding, multiplying, and converting between currencies easy. One of its core features is autocasting - when working with multiple currencies, it automatically converts them to match the first currency used.
# What My Project Does
Currex is a Pythonic currency calculator that makes working with currencies and exchange rates simple and smooth. It allows you to:
- Add, subtract, multiply, and divide currencies as if they were numbers
- Easily convert between currencies (e.g., USD to EUR)
- Autocast when mixing multiple currencies (they automatically convert to the first currency referenced)
- Fetch exchange rates from [HexaRate](https://hexarate.paikama.co/) in real-time
Here's a simple example:
```python
from currex import *
# use currencies as if they were numbers
100 * USD # USD(100.00)
12 * USD(100) # USD(1200.00)
# convert currencies to other currencies
USD(100).to(EUR) # EUR(85.30)
USD(100).to(PLN) # PLN(430.50)
# this syntax is also supported
PLN(EUR(12)) # PLN(51.33)
/r/Python
https://redd.it/1i9sn69
Repo: [https://github.com/stared/currex](https://github.com/stared/currex)
Demo: [try in Google Colab without installing anything](https://colab.research.google.com/github/stared/currex/blob/main/currex.ipynb)
I often use Python as a command-line calculator. However, I frequently found myself going back to Google Search to convert between currencies. So, I created this library to make adding, multiplying, and converting between currencies easy. One of its core features is autocasting - when working with multiple currencies, it automatically converts them to match the first currency used.
# What My Project Does
Currex is a Pythonic currency calculator that makes working with currencies and exchange rates simple and smooth. It allows you to:
- Add, subtract, multiply, and divide currencies as if they were numbers
- Easily convert between currencies (e.g., USD to EUR)
- Autocast when mixing multiple currencies (they automatically convert to the first currency referenced)
- Fetch exchange rates from [HexaRate](https://hexarate.paikama.co/) in real-time
Here's a simple example:
```python
from currex import *
# use currencies as if they were numbers
100 * USD # USD(100.00)
12 * USD(100) # USD(1200.00)
# convert currencies to other currencies
USD(100).to(EUR) # EUR(85.30)
USD(100).to(PLN) # PLN(430.50)
# this syntax is also supported
PLN(EUR(12)) # PLN(51.33)
/r/Python
https://redd.it/1i9sn69
GitHub
GitHub - stared/currex: A Pythonic currency calculator with real-time exchange rates
A Pythonic currency calculator with real-time exchange rates - stared/currex
Best AI for python programming?
I've been using Chatgpt, but it isn't up to the mark. Like it can code but when I prompt it to code without this module/function, it fails most of the time. Would love to get to know which AI does the best.
/r/Python
https://redd.it/1iabwj1
I've been using Chatgpt, but it isn't up to the mark. Like it can code but when I prompt it to code without this module/function, it fails most of the time. Would love to get to know which AI does the best.
/r/Python
https://redd.it/1iabwj1
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
D Simple Questions Thread
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/1iai5g6
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/1iai5g6
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Deploying Django and Wagtail on Cloud Servers: A Step-by-Step Guide
🚀 Are you struggling to deploy your Django or Wagtail projects on cloud servers like AWS, DigitalOcean, or Hetzner? I’ve been there too, which is why I’ve documented the entire process to help others simplify their deployment journey!
I’m excited to share two repositories that provide comprehensive deployment guides:
1️⃣ Django Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Django Hetzner Deployment
2️⃣ Wagtail Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Wagtail Hetzner Deployment
These repositories include:
✅ Setting up your server environment
✅ Installing necessary dependencies (e.g., Docker, PostgreSQL)
✅ Configuring Nginx and Gunicorn for production
✅ Tips for handling static and media files
✅ Streamlined deployment steps
Whether you’re hosting on AWS, DigitalOcean, Hetzner, or another provider, the principles outlined here can be easily adapted to fit your setup.
💡 Why I created this:
I wanted to make it easier for developers to deploy their projects without running into unnecessary roadblocks. If you’re new to cloud hosting or looking for a practical guide, this documentation might be just what you need.
I’d love to hear your feedback or suggestions for improvement. Let me know if these guides help you, or feel free to contribute
/r/django
https://redd.it/1iaa8om
🚀 Are you struggling to deploy your Django or Wagtail projects on cloud servers like AWS, DigitalOcean, or Hetzner? I’ve been there too, which is why I’ve documented the entire process to help others simplify their deployment journey!
I’m excited to share two repositories that provide comprehensive deployment guides:
1️⃣ Django Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Django Hetzner Deployment
2️⃣ Wagtail Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Wagtail Hetzner Deployment
These repositories include:
✅ Setting up your server environment
✅ Installing necessary dependencies (e.g., Docker, PostgreSQL)
✅ Configuring Nginx and Gunicorn for production
✅ Tips for handling static and media files
✅ Streamlined deployment steps
Whether you’re hosting on AWS, DigitalOcean, Hetzner, or another provider, the principles outlined here can be easily adapted to fit your setup.
💡 Why I created this:
I wanted to make it easier for developers to deploy their projects without running into unnecessary roadblocks. If you’re new to cloud hosting or looking for a practical guide, this documentation might be just what you need.
I’d love to hear your feedback or suggestions for improvement. Let me know if these guides help you, or feel free to contribute
/r/django
https://redd.it/1iaa8om
GitHub
GitHub - Matu-sunuwawa/Django_Hetzner_deployment
Contribute to Matu-sunuwawa/Django_Hetzner_deployment development by creating an account on GitHub.
Django e-commerce
In the past couple of months, i have been updating my Django e-commerce project and would love to share.
It mainly involves utilizing Django template, DigitalOcean, Whitenoise for static files, and Azure for PostgreSQL, and Azure Blob Storage for handling media only
https://voxmart.co.tz/
/r/django
https://redd.it/1ia59ga
In the past couple of months, i have been updating my Django e-commerce project and would love to share.
It mainly involves utilizing Django template, DigitalOcean, Whitenoise for static files, and Azure for PostgreSQL, and Azure Blob Storage for handling media only
https://voxmart.co.tz/
/r/django
https://redd.it/1ia59ga
Voxmart Tanzania | Online Shopping Mall
Tanzania leading online store. Fast, reliable delivery to your door.
Many ways to pay. Find the largest selection from all brands & store at the lowest prices in Tanzania.
Shop anything you can imagine: TVs, laptops, cellphones, kitchen appliances…
Many ways to pay. Find the largest selection from all brands & store at the lowest prices in Tanzania.
Shop anything you can imagine: TVs, laptops, cellphones, kitchen appliances…
I have been enjoying django these months
I researched the suitable stack to use before working on the product idea in mind, some folks crucified Django while others praised it. But learning to know of some major tech coys using Django is some relief.
We built a mentee meet mentor app for data & AI folks purely on Django at the backend and it has been fun. Though I want to improve API response time in deployment, I'm good outside that. https://semis.reispartechnologies.com/. Mentors can host group sessions and share their profiles for folks to connect with them.
Django at the backend is great, our app has evolved and will still do. Currently, we vet mentors before accepting. We are not there yet obviously, it's a learning experience for me. . Thank you Python & Django :)
/r/django
https://redd.it/1iaon81
I researched the suitable stack to use before working on the product idea in mind, some folks crucified Django while others praised it. But learning to know of some major tech coys using Django is some relief.
We built a mentee meet mentor app for data & AI folks purely on Django at the backend and it has been fun. Though I want to improve API response time in deployment, I'm good outside that. https://semis.reispartechnologies.com/. Mentors can host group sessions and share their profiles for folks to connect with them.
Django at the backend is great, our app has evolved and will still do. Currently, we vet mentors before accepting. We are not there yet obviously, it's a learning experience for me. . Thank you Python & Django :)
/r/django
https://redd.it/1iaon81
Reispar
Increase Retention. Improve Profit. Empower Employees with Semis
Semis platform — mentorship, knowledge sharing, and growth tools for companies to reduce attrition and increase retention.
How do I host flask web application on ubuntu VPS? (hostinger)?
recently i purchased a vps from hostinger but unfortunately there's no support for python flask but it allows various apps, panels, and plain OS as well. but i genuinely don't know what I'm doing. and I do want to connect a custom domain as well.
/r/flask
https://redd.it/1iao8zo
recently i purchased a vps from hostinger but unfortunately there's no support for python flask but it allows various apps, panels, and plain OS as well. but i genuinely don't know what I'm doing. and I do want to connect a custom domain as well.
/r/flask
https://redd.it/1iao8zo
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Django, Postgres, and Pytest
Apologies for the rather basic question, but I'm developing an app locally and have just switched from sqlite to postgres. The database for the app is working fine, but not so the temporary database that Pytest (or unittest) sets up. I keep getting errors like this: 'django.db.utils.ProgrammingError: relation "users_customuser" does not exist', which suggests that the tables in the test DB are not being created correctly. I've tried mucking around with migrations, and the USER permissions for the test DB appear appropriate (though by no means do I have a lot of expertise with postgres). I'm wondering if anyone knows the answer to this, or is aware of some kind of resource or tutorial out there that focuses on the intersection of Django, postgres, and testing?
/r/django
https://redd.it/1iatk98
Apologies for the rather basic question, but I'm developing an app locally and have just switched from sqlite to postgres. The database for the app is working fine, but not so the temporary database that Pytest (or unittest) sets up. I keep getting errors like this: 'django.db.utils.ProgrammingError: relation "users_customuser" does not exist', which suggests that the tables in the test DB are not being created correctly. I've tried mucking around with migrations, and the USER permissions for the test DB appear appropriate (though by no means do I have a lot of expertise with postgres). I'm wondering if anyone knows the answer to this, or is aware of some kind of resource or tutorial out there that focuses on the intersection of Django, postgres, and testing?
/r/django
https://redd.it/1iatk98
Reddit
From the django community on Reddit
Explore this post and more from the django community