You cannot host a Django application on Netlify. Netlify serves pre-built static files plus short-lived serverless functions; Django is a long-running Python process that needs a persistent database connection, a WSGI or ASGI server, and somewhere to write files. Those are different products, and no amount of configuration bridges the gap.
This needs saying bluntly because the search results for this question are genuinely contradictory. There are step-by-step guides and video tutorials promising to host Django on Netlify, and there are Netlify staff replies on their own forum stating flatly that it is not possible. Both are describing something real — they are just not describing the same thing. Sorting that out is most of the value here, and the rest is the deployment shape that actually works.
Table of contents
- The direct answer
- Why the tutorials that say yes are not lying, exactly
- What Django actually needs to run
- The split that does work: static frontend, Django API
- Deploying Django as an actual service
- Static and media files are a separate decision
- How this fits the rest of the stack
- FAQ
The direct answer
Netlify is a host for static assets and serverless functions. Its build step runs your build command, collects the output directory, and distributes those files. At request time it serves files from a CDN and can invoke functions that start, respond, and terminate.
Django is none of those things. A Django application is a persistent process, started by a WSGI or ASGI server, that holds database connections, keeps a session backend, runs middleware on every request, and serves dynamically rendered responses. Nothing in Netlify’s model runs that process.
So the answer is no, and it is a categorical no rather than a missing feature. It is the same shape of answer as asking whether you can run a Postgres server on a CDN.
Why the tutorials that say yes are not lying, exactly
Three distinct things get published under this title, and all three are technically doing something.
- Static export via a site generator. Some guides pair Django with a static generator so the output is plain HTML, and that HTML is what goes on Netlify. This works, but what is deployed is a set of files. Django is not running. Every dynamic feature — logins, forms that write, admin, querysets evaluated at request time — is gone.
- Deploying only the frontend. The most common video-tutorial shape. A React or Vue frontend that talks to a Django API goes on Netlify, and the API is quietly hosted elsewhere. This is a perfectly good architecture that has been mislabelled. Netlify is hosting the frontend, not Django.
- It does not actually work. Some guides deploy, show a page, and never demonstrate a request that touches the database.
Netlify’s own support forum is the clearest source on this: their staff answer states directly that hosting a Python or Django app is not possible because Netlify is for static and JAMstack sites. When a vendor’s support team says their platform does not do something, that outranks a third-party tutorial.
The useful version of the question is not whether Django runs on Netlify. It is whether Netlify can serve the part of your application that is static — and the answer to that is yes.
What Django actually needs to run
Listing the requirements makes it obvious which of them a static host can satisfy:
- A Python runtime, at a version your dependencies support.
- A WSGI or ASGI server — gunicorn or uvicorn — supervising worker processes that stay alive between requests.
- A database. Postgres or MySQL for anything real. SQLite on ephemeral disk is a development convenience that loses your data on redeploy.
- Environment variables for the secret key, database URL, allowed hosts, and debug flag.
- A migration step at deploy time, run against the database before the new code starts serving.
- Somewhere for static files, produced by
collectstatic, and somewhere separate for user-uploaded media that survives a redeploy.
A static host can genuinely help with exactly one item on that list — serving the collected static files. That is a real contribution and it is also the whole extent of the overlap.
The split that does work: static frontend, Django API
If you arrived here because you wanted Netlify specifically, this is the architecture you were probably reaching for anyway.
Deploy the frontend as a static build — a React, Vue, or Angular app compiled to files. Deploy Django separately as a service that exposes a JSON API. The frontend calls the API over HTTPS. Two deploy targets, one product.
Two things need care in this shape. CORS, because the frontend is now on a different origin than the API and the browser will block the calls until Django says otherwise — django-cors-headers with an explicit allowed-origins list, never a wildcard in production. And authentication, because cookie-based sessions across origins require deliberate SameSite and Secure configuration, which is why many teams move to token auth at this point rather than fighting cookie policy.
The upside is real: the frontend gets CDN distribution and instant rollbacks, and the API scales on its own terms. The downside is two deployments to keep in step and a CORS configuration to get wrong at least once.
Deploying Django as an actual service
If your Django app renders its own templates — which most do — you do not want the split at all. You want one service running the whole application. The deployment is not complicated:
# Serve the app
gunicorn myproject.wsgi:application --bind 0.0.0.0:8000 --workers 3
# Run before the new version starts serving
python manage.py migrate --noinput
python manage.py collectstatic --noinput
The settings that need to come from the environment rather than the repository:
import os
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
DEBUG = os.environ.get('DJANGO_DEBUG', 'false').lower() == 'true'
ALLOWED_HOSTS = os.environ['DJANGO_ALLOWED_HOSTS'].split(',')
DATABASES = {'default': dj_database_url.config(conn_max_age=600)}
Note conn_max_age. Django closes its database connection after every request by default, and on a managed database that reconnect cost is measurable under load. Setting it to persist connections is one line and one of the highest-return changes available on a Django deployment.
On RunxBuild this is a Python service deployed from the GitHub repository, with build logs, a live route, environment variables, runtime logs, and rollback to the previous deploy. The managed database sits beside it — Postgres or MySQL, with backups, connection limits, and private networking, documented at Databases on RunxBuild. The general plan ladder starts at $4 for Dev and $6 for Basic, with 1GB of RAM at $13 on BasicMini, and autoscaling between a floor and ceiling plan if traffic is uneven.
The rollback matters more than it sounds for Django specifically. A deploy that runs a migration and then fails is the worst deployment failure this stack produces, and having the previous version one click away is what turns it from an incident into an inconvenience.
Static and media files are a separate decision
These two get conflated constantly and they have different requirements.
Static files are your CSS, JavaScript, and images — produced by collectstatic at build time, identical for every user, and safe to regenerate on every deploy. WhiteNoise serves them straight from the Django process with compression and cache headers, and for most applications that is sufficient and removes an entire moving part.
Media files are user uploads. They are created at runtime, must survive a redeploy, and must not be regenerated. They need either persistent storage attached to the service or an S3-compatible object store. Writing them to the container filesystem is the single most common data-loss bug in Django deployments, and it is invisible until the first redeploy after a user uploads something.
Decide this before launch. The migration from container filesystem to real storage is straightforward on day one and an archaeology project after six months of uploads.
How this fits the rest of the stack
Django on Netlify is not a configuration problem, it is a category error — Netlify serves files and short functions, Django is a process with a database. The tutorials claiming otherwise are deploying a static export or a decoupled frontend and labelling it Django. Pick the shape you actually need: a static frontend plus a Django API if the frontend is a compiled app, or a single Python service if Django renders your templates. Then get the media-file decision right before your first upload. If you want the cost of the service, the database, the storage, and the bandwidth on one page before you commit, the RunxBuild hosting calculator itemises them.
Useful related references:
- Django Environment Variables: django-environ, os.environ, and 12-Factor
- How to Shut Down a Django Server Running on Localhost
- Django vs FastAPI: An Honest 2026 Comparison for Backend Teams
- Python services on RunxBuild
FAQ
Can you deploy Django on Netlify?
No. Netlify hosts static files and short-lived serverless functions. Django requires a long-running Python process with persistent database connections, which Netlify does not provide. Netlify’s own support staff state this directly on their forum.
Why do tutorials show Django being deployed to Netlify?
They are deploying something else and calling it Django. Usually either a static export generated from Django, in which case Django is not running, or a separate frontend that calls a Django API hosted elsewhere. The second is a good architecture with a misleading title.
Can I host my React frontend on Netlify and Django elsewhere?
Yes, and this is the sensible version of the idea. Build the frontend to static files and host it anywhere static, run Django as a service that exposes a JSON API, and connect them over HTTPS. Configure CORS with an explicit origin list and plan the authentication strategy across origins.
What does Django need that a static host cannot provide?
A persistent Python process, a WSGI or ASGI server, a live database connection, environment variables at runtime, a migration step at deploy, and durable storage for user uploads. A static host can serve the collected static files and nothing else on that list.
Where should Django media files go in production?
Not on the container filesystem. Use persistent storage attached to the service, or an S3-compatible object store. Files written to an ephemeral container disk disappear on the next deploy, and the loss is silent until someone looks for an old upload.