Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
DevOps

When Django is the right choice, and when it is not

Django 6.1 in practice: what its admin, ORM and security defaults do best, where async and API-only work fall short next to FastAPI, and how to deploy it.

CloudSat teamNovember 18, 20266 min read
Abstract illustration of a green scaffold holding modular blocks above a softly glowing server rack
On this pageWhat is current

Django is two decades old and still ships on a steady schedule, so the useful question is not whether it is alive but whether its shape fits your app. It bundles an ORM, migrations, an admin, authentication, forms and templates, and it expects you to use them. That is a gift for a database-backed product with users and a back office, and dead weight for a small async API. Here is what is current in November 2026, where Django wins, where it struggles, and what a deployment on one server looks like.

What is current

Series Released Security support until
5.2 LTS April 2025 April 2028
6.0 December 2025 April 2027
6.1 (latest: 6.1.3) August 2026 December 2027
6.2 LTS Planned for April 2027 April 2030

After 6.2, Django switches to calendar versioning: feature releases become Django 2028, Django 2029 and so on, one each January. The 6.x series needs Python 3.12 or newer, and 6.1 dropped PostgreSQL 14, MySQL older than 8.4 and MariaDB older than 10.11.

The last two releases added more than polish:

  • 6.0 brought built-in Content Security Policy headers (ContentSecurityPolicyMiddleware and the SECURE_CSP setting), template partials, the django.tasks framework for queuing background work, a mail API built on Python's modern email package, and BigAutoField as the default primary key type.
  • 6.1 added fetch modes: FETCH_PEERS loads a missing field for every object of a queryset at once, which turns the classic N+1 query loop into two queries, and FETCH_RAISE makes unintended queries fail loudly in tests. It also added database-level ON DELETE options such as DB_CASCADE, and a MAILERS setting for several named email backends.

What Django still does best

  • The admin. Register a model and you get a working back office: lists, filters, search, editing and permissions. For internal tools and operations teams, that alone can save weeks.
  • ORM and migrations. Models define the schema, makemigrations writes the changes, and migrate applies them the same way on every machine. PostgreSQL, MariaDB, MySQL, SQLite and Oracle are supported in core.
  • Accounts and permissions. Users, groups, per-model permissions, sessions and password hashing come built in and well tested.
  • Security defaults. CSRF protection, auto-escaping templates, clickjacking protection, parameterized SQL and now CSP, plus manage.py check --deploy to audit settings before launch.
  • Predictability. Fixed release dates, LTS versions with three years of support and a documented deprecation policy keep upgrade work small and plannable.

Where it is weaker

Async is real, but partial

Under an ASGI server, Django runs async views on a fully async request stack. Every QuerySet method that hits the database has an a-prefixed variant, such as aget() and acreate(), and results can be read with async for. The gaps are documented: transactions do not yet work in async code, so the docs suggest moving transactional work into a synchronous function called through sync_to_async(). Persistent connections (CONN_MAX_AGE) should be disabled in async mode in favor of connection pooling, which Django offers natively for PostgreSQL. Any synchronous middleware between the server and an async view costs a thread switch on every request.

For a request that queries the database and returns, none of that matters much. It matters when the app mostly waits on other services, fans out to many HTTP calls, or holds thousands of long-lived connections. An async-first framework fits that work better.

Real-time features need Channels

Django has no built-in WebSocket support. Django Channels adds it with ASGI consumers and a channel layer, typically backed by Redis, to pass messages between processes. It works, but it is a second system to learn and run. For one-way updates, server-sent events from an async view are often enough.

API-only services carry unused weight

Django REST framework and Django Ninja are mature ways to build APIs on Django. Still, for a JSON service with no admin, templates or sessions, most of Django is weight you install and configure without using. FastAPI, which validates requests from type hints and generates OpenAPI documentation on its own, is the closer fit there. Litestar works in the same ASGI space with similar features.

Django, FastAPI or Flask

Need Django FastAPI Flask
Admin back office Built in Build or add Extension
ORM and migrations Built in Your choice, often SQLAlchemy and Alembic Your choice, often SQLAlchemy
Users, sessions, forms Built in Build or add libraries Extensions
Async I/O Partial Native Limited by its WSGI core
OpenAPI documentation Through Django Ninja or a DRF add-on Built in Extensions
Server-rendered pages Built in Possible, not its focus Built in, with Jinja

The table reduces to a few rules:

  • Choose Django for products built around a database, users and roles: SaaS dashboards, internal tools, marketplaces, content sites with custom logic.
  • Choose FastAPI or Litestar for API-only services, heavy async I/O, or a thin layer in front of a model or another service.
  • Choose Flask for small apps where you would rather pick every component yourself.
  • Mix them when one hot path needs async: keep the product in Django and move that path into a small FastAPI service next to it.

Deploying Django on a VPS

The shape on one server: Caddy or Nginx terminates TLS and serves static files, Gunicorn runs Django with Uvicorn workers for ASGI (or its own workers for WSGI), PostgreSQL stores the data, and systemd keeps everything running.

python3 -m venv /srv/mysite/.venv
. /srv/mysite/.venv/bin/activate
python -m pip install django gunicorn uvicorn uvicorn-worker "psycopg[binary]"
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py check --deploy

Before that last command passes cleanly, production settings need DEBUG = False, a SECRET_KEY read from the environment, ALLOWED_HOSTS, secure session and CSRF cookies, and a STATIC_ROOT for collectstatic. Behind a proxy that sets X-Forwarded-Proto, also set SECURE_PROXY_SSL_HEADER, but only if the proxy overwrites that header rather than passing on what clients send.

Run Gunicorn as a service:

# /etc/systemd/system/mysite.service
[Unit]
Description=mysite (Gunicorn with Uvicorn workers)
After=network.target postgresql.service

[Service]
User=mysite
Group=mysite
WorkingDirectory=/srv/mysite
EnvironmentFile=/etc/mysite.env
ExecStart=/srv/mysite/.venv/bin/gunicorn mysite.asgi:application \
    -k uvicorn_worker.UvicornWorker --workers 3 --bind 127.0.0.1:8000
Restart=on-failure

[Install]
WantedBy=multi-user.target

Then let Caddy serve static files and proxy the rest:

example.com {
    handle_path /static/* {
        root * /srv/mysite/staticfiles
        file_server
    }
    handle {
        reverse_proxy 127.0.0.1:8000
    }
}

Caddy sets X-Forwarded-Proto and ignores the value clients send, which is what SECURE_PROXY_SSL_HEADER relies on. Size the worker count from memory: each Gunicorn worker is a full copy of the app, so start small and watch real usage. Background jobs need a worker process of their own: the 6.0 tasks framework defines and queues tasks but leaves running them to a third-party backend, and Celery remains the common choice. Run that worker as a second systemd service.

On CloudSat, the Django one-click app starts from Ubuntu 24.04, whose Python 3.12 runs both 5.2 LTS and 6.x, and the Django hosting page shows the full stack.

FAQ

Should a new project start on 5.2 LTS or 6.1?

Start on 6.1 if you will upgrade at least once a year; you get the new features and a short step to 6.2 LTS in April 2027. Pick 5.2 LTS only if the app must run with minimal upgrade work until 2028.

Is Django fast enough?

For most database-backed apps, response time is decided by queries and caching, not the framework. Fix N+1 queries (6.1's fetch modes help), add indexes and cache expensive pages before blaming Django.

Can Django serve WebSockets?

Not on its own. Use Django Channels for two-way connections, or server-sent events from an async view for one-way updates.

Do I still need Celery with django.tasks?

You need some worker. django.tasks standardizes how tasks are defined and queued, but its built-in backends run tasks immediately or not at all and are meant for development and tests. Production needs a backend that brings a worker and a durable queue, or Celery.

Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.