r/django • • May 12 '26

2026 Django Developers Survey

Thumbnail djangoproject.com
39 Upvotes

r/django • • 15h ago

Models/ORM AI agents keep introducing N+1 queries in our Django app

24 Upvotes

We're a team of 5 working on a Django and DRF backend, and most of our new serializers and views are now written by AI agents. Twice this month, a list endpoint went from around 12 queries to over 300 because a SerializerMethodField was accessing related objects for every row. Both PRs passed tests and looked fine during review. We only caught the issue when our latency alerts started firing.

Here's what we've tried so far:

  • assertNumQueries tests: Added them to our 8 busiest endpoints. They catch the problem, but one agent actually increased the expected query count to get the test passing. That was frustrating.
  • nplusone in development: Configured it to raise errors instead of warnings. It helps, but nobody runs every endpoint locally.
  • CodeRabbit on every PR: It catches missing select_related or prefetch_related calls roughly two-thirds of the time, but often misses issues hidden inside serializer methods.
  • Django Debug Toolbar: Still useful, but honestly, nobody really checks it anymore.

For those of you working with AI-generated Django code, what's actually helped prevent N+1 queries from making it into production?

Is there a reliable CI check for this, or does it still come down to manually reviewing serializers?


r/django • • 7h ago

Hosting and deployment My Django + Channels app with 3 Celery processes runs on one Ubuntu VPS with no Docker. This is what prod looks like

Thumbnail gallery
5 Upvotes

Quick disclosure first: I built the tool in these screenshots. I'm posting it because the setup itself might be useful to someone, even if they never touch the tool.

My side project, Lazy Planner, is Django + Channels. In prod it has a web process, Celery beat, a normal worker and a separate worker for AI jobs, plus Postgres 18 and Redis 8. All of it sits on one Ubuntu server. Every process is a plain systemd unit and Caddy sits in front.

Some real numbers from the screenshots: web uses 222 MB, worker 264 MB, the AI worker 260 MB, beat 135 MB and Redis 7 MB. Postgres has 48 tables and a 100% cache hit rate, which says more about how small my data is than anything else.

The stuff I used to do by hand on every project, and now don't:

  • push to main and it deploys (about 2.5 min for this app)
  • a staging copy, plus a preview for each branch
  • daily Postgres backups I can actually see in the UI
  • logs from all processes in one place instead of running journalctl on each unit

It's in beta and so far it's mostly been my own apps on it. If someone wants to point it at their Django repo and tell me where it falls over, one project is free. Setups that aren't mine are where I'll find the bugs. It's at deploywithox.com.

How are you all running Celery beat in prod? systemd, supervisor, a container, something else?


r/django • • 1h ago

Django + SvelteKit document workspace (a Docmost-style app). Would you want this open sourced?

Thumbnail gallery
• Upvotes
I've been building SwiftDoc, a private workspace for writing and releasing documents. People share spaces and pages, comment in the app, and can send a page through an approval workflow before it is published. Closest comparison is Docmost or Outline, with sign-off in the middle.


It is not open source yet. I'm posting to see if anyone here would actually want the code.


**Stack**


- Django REST API, session auth, and permission checks
- Django Channels for live page updates
- SvelteKit and TipTap for the editor
- Hocuspocus and Yjs for collaborative editing
- Postgres and Redis


**What you can do**


- Workspaces and spaces, with folders and a page tree
- Write with headings, lists, tables, callouts, code, math, Mermaid, Draw.io, and Excalidraw
- Comment on a quote and u/mention a teammate. Notices stay in the app
- Attach an approval workflow to a space, so a page is signed in order and only then published. A published page in that space stays locked until someone opens a revision
- Page templates, revision history, and a view of changes since the last publish
- Search across pages
- Export HTML, Markdown, and PDF


The screenshots are a local demo, not a hosted one. If this is interesting, what would you want to see before an open-source release was worth it? I'm especially curious what people would poke at on the Django side

r/django • • 4h ago

Apps I wrote a simple library which allows you to provide TOON serialization/parsing/rendering in Django Rest Framework

1 Upvotes

https://github.com/dashdanw/drf-toon

Using the toon-format library for toon encoding which optimizes an API response for tokenization by an LLM. I would like to (in the future) potentially use a rust implementation to speed up parsing, but it works fairly well for now.


r/django • • 6h ago

I built a small Django app that tells you which of your projects are on an unsupported Django version

0 Upvotes

I have a few older Django projects that I am mainting and was loosing track of which were past end of support and which had been updated (4.2 ended in April). So I made a small tracker app so I didnt need to worry about it anymore.

By adding a project and its Django version, it shows whether that version is still supported, days left, and what to upgrade to either the newest LTS (5.2) and newest release (6.1). There is also a input field on the front page for any version which will vaildate the release supplied and give you number of days left as a view with nothing saved.

Release dates themselves are managed in the Django admin and come from djangoproject.com/download. Month-only dates like "April 2028" are kept as months, and days left count to the 1st of the month.

Disclosure: I work on Uppcoder and built this app with our AI builder to see how it handles Django. One prompt, about 7 minutes and 32 cents of free AI was about all it took. A second prompt got me a login and the version check. Migrations, a seed data migration and the admin setup were all there. I then edited it in VS Code in the browser with PostgreSQL already wired up.

Live: https://ghoo8qe3-django-django-support-track.apps-2.websson.cloud/?ref=reddit

Curious as to whether or not others would count month-only EOL dates to the start or the end of the published month.


r/django • • 13h ago

Email sending error

Post image
0 Upvotes

I’ve used built in Django SMTP Email function in my project and after sending 10,20 emails the further emails are not sending and showing blocked messages and I’ve read that it can send 500 emails daily but don’t know why it’s blocking after 15,20 emails, give suggestions and ideas


r/django • • 1d ago

DjangoCon 2026 Videos are up on Youtube now!

Thumbnail youtube.com
18 Upvotes

Here is a playlist of all of the videos from this year.


r/django • • 19h ago

Stop Django Bulk Operations From Silently Skipping Signals

Thumbnail johnnymetz.com
1 Upvotes

r/django • • 1d ago

Speaker Highlights: Case study talks at Wagtail Space 2026

Thumbnail gallery
3 Upvotes

r/django • • 21h ago

Recruiting Student Developers for a High-School Energy Optimization Project (Python, Django, PostgreSQL)

0 Upvotes

Hi everyone!

I'm leading a team of high-school students working on a project called the Smart Energy Optimization System. Our goal is to develop a web application that helps households optimize electricity usage, schedule appliances efficiently, and make better decisions about energy use and backup power during outages.

We're looking to expand our team with motivated students who want hands-on experience contributing to a real technical project.

We're especially looking for people interested in:

  • Backend development: Python and Django
  • Database and deployment: PostgreSQL, hosting, and maintaining our application
  • Frontend development: Building a clean, user-friendly interface
  • Energy research and optimization: Researching energy-use patterns and helping develop our optimization logic

You don't need to be an expert, but you should be willing to learn, communicate with the team, and contribute consistently. We're particularly interested in people who can take ownership of a specific part of the project.

This is an unpaid extracurricular passion project, not a job or internship. It's an opportunity to collaborate with other students, develop practical technical skills, and contribute to a project with a real-world purpose.

Interested? Comment below or send me a message with your technical interests, relevant experience, and the role you'd like to work on.

Thanks!


r/django • • 1d ago

What is the best platform for backend developer to keep up or improve their coding.

6 Upvotes

I know about hackerrank ,leetcode for coding practice but I was hoping for more backend problems or improving code quality ,even new skills like db indexing,cloud. If not platform please provide tips or schedule for achieving that.


r/django • • 2d ago

A Django-based static site generator in 3 lines of code

Thumbnail nanodjango.dev
24 Upvotes

r/django • • 2d ago

Natalia Bidart - Planned short-term leave

Thumbnail djangoproject.com
15 Upvotes

r/django • • 1d ago

I built DoveORM, a lightweight Python ORM with built-in migrations — looking for feedback

Thumbnail
0 Upvotes

r/django • • 2d ago

Data organise

0 Upvotes

Hi everyone. I need your help. I need to organise my data somehow in “data.py” file. Now I don’t use database, so I need your recommendation how to do this, for they later I can easily switch it in database. P.S. I would do db from the start but this is a task from my teacher


r/django • • 3d ago

Hosting and deployment Performance with db

Thumbnail gallery
7 Upvotes

I had created a post : https://www.reddit.com/r/django/s/DVeZXAHGhs about the performance of the db that I was using with my personal project. I got many helpful suggestions from the post and tried to find what the root cause was but I didn't find anything in particular. Then I used the same application with a local dev db and compared the performance and the result is huge difference. Here the first one is from my local machine, and the second is from the postgres from neon db (free tier).

Before you state the obvious, yes the local server is supposed to take much less time the the one that is hosted somewhere and you need to communicate over the network, now with this can I be sure that the issue is with the Db provider, at first I was wonder if I the code was inefficient or there was something wrong with my code.

and still, neon db is a popular provider and I can't understand why would their provided db be that it is noticeable request is noticeable?


r/django • • 4d ago

Podcast HTMX creator on HTMX 4, the history of REST and how he views AI

Thumbnail youtu.be
17 Upvotes

I host a podcast for senior engineers and recently had Carson Gross, creator of HTMX, on as a guest. We covered how REST was originally defined, how the industry ended up calling JSON over HTTP "REST", and why he thinks returning HTML from the server is closer to the original idea.

We also got into HTMX 4, when you actually do need a SPA, and how AI changes the tradeoff between simple and clever code.

Full episode: https://youtu.be/9xs0oZN2rs4

4' video on the history of REST: https://www.youtube.com/watch?v=DbNvpiJ9gTs


r/django • • 3d ago

High School Project Looking for a Coder/Developer

Thumbnail
0 Upvotes

r/django • • 3d ago

Would like for users to test my site!

Thumbnail
0 Upvotes

Would like a update on my project


r/django • • 4d ago

Express vs Django

0 Upvotes

Which one is better for web development, I mainly use Express, but is Django also good? For frontend, I use react, for database I use mongoDB, does mongoDB work on Django as well?


r/django • • 5d ago

Is this normal performance or not?

Thumbnail gallery
9 Upvotes

Hello guys, I am building a personal project simple blog application with react frontend and drf backend, for image upload I have used Cloudinary and have deployed the backend in vercel and used postgers from neon db put the amount of time it is taking for a request to complete is quite noticeable is this normal ? all of the things I am using here is free tier. during development I have used the debug toolbar and I have made sure that there is no n + 1 condition, I see the response time in sites like youtube, facebook the request is completed within milliseconds.

This is my first time deploying things so any help would be really appreciated plus even when I run the local backend server which is using cloudinary and neon db it takes about half of the time shown in the below picture, within the local dev server too it taks about 1-2s on average.


r/django • • 5d ago

REST framework DRF skips has_object_permission on list endpoints. How do you keep get_queryset scoped?

1 Upvotes

In Django REST Framework, object permissions only run when a view calls get_object(). Retrieve, update and destroy do that. List doesn't, so a permission class that checks obj.workspace_id == request.user.workspace_id protects the detail routes and does nothing for the list route. If get_queryset is still Project.objects.all(), the list returns every workspace's rows. Same goes for a custom @action(detail=False), or an overridden get_object that forgets to call check_object_permissions.

Filtering in get_queryset fixes it, but then the rule lives in two places, and nothing fails when the next viewset gets written without the filter.

How are people handling this?

  • A base viewset whose get_queryset always applies the tenant filter, with an explicit opt-out?
  • A for_user(user) queryset method plus a review or lint rule?
  • Tests that create data in two workspaces and call every list route as the wrong user?

Also curious if anyone runs django-guardian's get_objects_for_user on large tables and how it holds up.


r/django • • 5d ago

Django REST Framework API architecture

0 Upvotes

One thing I've found important when structuring a Django REST Framework project is keeping the API layer separate from business logic.

I generally use serializers for input validation and response formatting, views or viewsets for handling HTTP requests, and a separate service layer when the business logic becomes complex enough to justify it.

For example, if an endpoint creates an order, I wouldn't put all the pricing calculations, inventory checks, and payment-related logic directly inside the view. I'd keep those operations in reusable functions or services, with database transactions where consistency requires them.

I also pay attention to a few things early on:

  • Consistent API error responses.
  • Authentication and object-level permissions.
  • Query optimization with select_related() and prefetch_related() where appropriate.
  • Automated tests for important business rules.
  • Pagination and filtering for endpoints that return large datasets.

I wouldn't introduce a service layer for every simple CRUD operation, though. For a small application, Django's built-in patterns can be perfectly adequate. The goal is to keep the code understandable as the application grows, not to add abstraction for its own sake.


r/django • • 6d ago

Hosting and deployment New to Django + Gunicorn + Nginx: what's your workflow for efficient development, deployment, and debugging in production?

21 Upvotes

Hi all! I'm new to production Django (Django + Gunicorn + Nginx) and want to build good habits early.

What are your best practices for:

- Development: local setup, settings split, must-have tools

- Deployment: Docker vs systemd, CI/CD, static files, secrets

- Debugging in production: logging, monitoring, error tracking

- Mistakes to avoid

Any tips, tools, or resources welcome. Thanks! 🙏