Django hosting in 2026: how to deploy a Django app, and where
A Django app in production needs a WSGI or ASGI server instead of runserver, DEBUG off, ALLOWED_HOSTS set, collected static files and migrations on every deploy. On Livops a repository with manage.py and requirements.txt gets all of that from a push, for 39 credits a month (39,000 so'm). Here is how Render, Railway, Fly.io and a VPS compare.
By Livops team, the people who build and run LivopsUpdated
Hosting a Django app is not hard, but it is easy to get half right: the site works on your laptop with runserver and DEBUG = True, and production needs neither. This page lists what Django itself asks for in production, compares Render, Railway, Fly.io and a VPS with each provider’s own numbers, and ends with the exact files Livops reads and the command it starts.
What does a Django app need in production?
A real server, not runserver
manage.py runserver is for development: Django’s own documentation says not to use it in production, because it has not been through security audits or performance tests[2]. In production a WSGI server runs the project’s wsgi.py (Gunicorn is the usual one), or an ASGI server runs asgi.py when you use Channels and websockets. Gunicorn binds 0.0.0.0:$PORT when PORT is set, and starts as many workers as WEB_CONCURRENCY says, one if it is not set[5]. Its own starting point for the count is two per CPU core plus one[6]; on a small container, two or three is plenty, and each worker is another copy of your app in memory.
Production settings
Three settings change between your laptop and the server[1]:
DEBUG = False. Django is explicit: never enable debug in production.SECRET_KEYfrom the environment, never committed to the repository.ALLOWED_HOSTS. WithDEBUGoff, every request whose host is not on the list gets “Bad Request (400)”[3].
Behind an HTTPS proxy there is a fourth. For a form posted with an Origin header, Django’s CSRF check wants that origin to match the host the request came to[3], and behind a proxy Django may believe the request was plain HTTP. List your HTTPS origins in CSRF_TRUSTED_ORIGINS, or the admin login fails with a CSRF error. Set SESSION_COOKIE_SECURE and CSRF_COOKIE_SECURE to True, and run python manage.py check --deploy against the production settings once[1].
import os
DEBUG = os.environ.get("DEBUG") == "1"
SECRET_KEY = os.environ["SECRET_KEY"]
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",")
CSRF_TRUSTED_ORIGINS = ["https://" + host for host in ALLOWED_HOSTS if host]
SESSION_COOKIE_SECURE = CSRF_COOKIE_SECURE = not DEBUG
Static files
The development server serves static files for you; in production you set STATIC_ROOT and collectstatic copies them there[1]. Something then has to serve that folder. On a platform the simplest answer is WhiteNoise: its middleware goes directly after SecurityMiddleware, and it serves what collectstatic put into STATIC_ROOT[4].
A database, and migrations on every deploy
SQLite in the code folder is lost on the next deploy on most platforms. Use PostgreSQL, read its address from an environment variable, and run migrate before each new version starts, so the tables exist when the first request arrives.
Somewhere for background work
Sending email, resizing images and nightly reports do not belong in a request. Celery, RQ or Django’s own tasks need a second, always-running process (a worker), and a management command on a timer needs cron. Count them when you compare prices: each is a process of its own.
The options at a glance
| Option | What it is | Smallest paid always-on web service | PostgreSQL | What you still maintain |
|---|---|---|---|---|
| Livops | A platform; servers in Uzbekistan | 39 credits (39,000 so’m) a month | 500 MB free, one per team; 1 GB for 9 credits a month | Your code |
| A VPS in Uzbekistan | A virtual machine with root | 82,000 so’m a month: 1 vCPU, 2 GB, 30 GB HDD (SmartCloud)[7] | Whatever you install | The system, Gunicorn as a service, Nginx, HTTPS, backups, deploys |
| Railway | A platform billed by usage | Hobby plan: $5 a month, including the same amount of usage; then about $10 per GB of RAM and $20 per vCPU a month[8] | A service billed by the same usage, its volume about $0.15 per GB a month[8] | Your code |
| Render | A platform | $7 a month: 0.5 CPU, 512 MB[9] | From $6 a month: 256 MB, plus $0.30 per GB of storage[9] | Your code |
| Fly.io | Virtual machines billed by the second | $2.19 a month for shared-cpu-1x with 256 MB; $3.69 with 512 MB[11] | Managed Postgres from $38 a month (Basic)[11] | Your code |
Other providers’ prices are from each provider’s own page, read on 20 November 2026; the dates are in Sources below. Livops prices are the ones the cabinet bills today.
Each option
Livops
A Django repository is recognised and set up without a form to fill in: the server, migrate, collectstatic and ALLOWED_HOSTS are handled (details below). Connect a GitHub repository or upload a folder, and every git push ships a new version. Payment is in so’m through Payme or Click, with no card, and the servers are in Uzbekistan — close to users there, farther from users elsewhere. You do not get root on the machine; a project that needs its own system packages runs from its own Dockerfile, or is better on a VPS.
A VPS
The most control for the money, and the cheapest way to run several Django projects side by side: the cheapest 2 GB machine at SmartCloud is 82,000 so’m a month[7]. Everything else is yours: Python, a systemd unit for Gunicorn, Nginx in front for HTTPS and static files, PostgreSQL and its backups, and a deploy script that runs migrate and collectstatic in the right order.
Railway
The Hobby plan is $5 a month and includes that much usage; past it, memory is about $10 per GB and CPU about $20 per vCPU a month, billed by the second[8]. It is paid by credit card[8]. Its regions are California, Virginia, Amsterdam and Singapore[13].
Render
A web service starts at $7 a month for 0.5 CPU and 512 MB, and PostgreSQL at $6 for 256 MB[9] — the clearest fixed price among the platforms here. Render takes credit and debit cards[9]. Regions are Oregon, Ohio, Virginia, Frankfurt and Singapore[12].
Fly.io
The lowest dollar price for the app itself: $2.19 a month for 256 MB, $3.69 for 512 MB[11]. The managed database is where it gets expensive, at $38 a month for the smallest plan[11]. A credit card is needed once the trial ends[11].
VPS or platform: what do you maintain?
On a VPS you are the operations team: when the disk fills, a certificate expires or a security update lands, it is yours to notice. On a platform you hand over a repository and the platform runs it; you give up root in return. If you like running servers, or you host many small projects, a VPS gives you the whole machine. If you would rather spend the time on the app, use a platform.
Where can you host Django for free?
- Livops has no free tier for apps. On an account that has not paid yet, the first bot or app runs for 15 minutes on a zero balance, once, so you can watch it answer. One 500 MB database per team is free, and starts once the account has credits.
- Render gives free instances to web services and PostgreSQL. A free web service spins down after 15 minutes without inbound traffic and takes about a minute to start again; each workspace gets 750 free instance hours a month; a free database expires 30 days after it is created and holds 1 GB[10].
- Railway has a Free plan with $1 of usage a month and up to 0.5 GB per service, whose services sleep after 5 to 10 minutes without outbound traffic; a trial gives $5 of credit for 30 days, with no card[8].
- Fly.io has no free tier for new organizations; a trial gives $1 of credit for 7 days[11].
Deploy Django on Livops
- Push a repository with
manage.py, your project folder andrequirements.txtwithdjangoandgunicornin it. In the cabinet, click New project and choose the repository, or upload the folder as a.zip. - Under Variables, add
SECRET_KEYand mark it as secret: its value is never shown again. - Under Databases, add PostgreSQL.
DATABASE_URLand thePG*variables are written into the service by themselves. - Deploy. The log shows the install,
collectstatic,migrateand the start.
Livops makes it a Django project when django is among the dependencies and manage.py sits beside a project folder with wsgi.py and settings.py, the way startproject lays it out. It installs requirements.txt (or the dependencies in pyproject.toml) into a virtualenv, and a .python-version or runtime.txt file picks the Python version. The start command it writes for a project named mysite:
.venv/bin/python manage.py migrate --noinput || echo 'Livops: migrate failed — the app starts anyway; look above'; exec .venv/bin/gunicorn mysite.wsgi:application --bind 0.0.0.0:3000
The server is the one you installed: Gunicorn if it is in the requirements; daphne or uvicorn on mysite.asgi for a project with Channels; uvicorn on asgi.py when that is the only server listed. With none of them, runserver is started — add gunicorn. A Procfile with a web: line that listens on 0.0.0.0 and $PORT is used instead, with migrate still run before it unless the line migrates itself.
What Livops does around it:
collectstaticruns during the build when the project hasdjango.contrib.staticfilesandSTATIC_ROOTis set. With WhiteNoise inMIDDLEWARE, the files are served from the same process.ALLOWED_HOSTSis set as a variable to the project’s address and the domains you connect, comma-separated, unless you set it yourself. Yoursettings.pymust read it, as in the snippet above.- After the deploy, Livops opens the home page; if Django refuses the host, the log says which host to add.
- If the new version does not start within a minute, the deploy fails and the version that worked keeps serving. If the build fails, the running version is left alone. Recent versions stay in Deploys for a one-click rollback.
- More Gunicorn workers: add
WEB_CONCURRENCYunder Variables; the command above names no worker count, so Gunicorn reads it. More workers need more memory: the tier is 256, 512, 1024 or 2048 MiB, set withmemoryinlivops.jsonwhen the project is created and in the settings afterwards. - Files written to
/app/data(theDATA_DIRvariable) survive restarts and deploys; the code folder is read-only and/tmpis wiped.
To set the commands yourself, put livops.json in the repository root:
{
"kind": "web",
"start": ".venv/bin/gunicorn mysite.wsgi:application --bind 0.0.0.0:$PORT"
}
A start you write replaces the whole line above, migrate included; put the migration in the Pre-deploy command in the settings, which runs once before each new version and keeps the old one serving if it fails.
A Celery worker or a management command on a timer is a service of its own, of type worker or cron, at 19 credits a month each; see Cron and workers.
A Django app is 39 credits a month (39,000 so’m). One credit is 1,000 so’m, and bought credits never expire. See Pricing for plans, which give more credits than they cost, and Frameworks for everything livops.json accepts.
Questions
Which server does Livops start Django with?
Gunicorn, when gunicorn is in your requirements: it runs your project's wsgi module on the port the platform gives. A project with Channels and daphne or uvicorn runs on its ASGI module instead. With no server listed at all, Django's own runserver is started, which Django says is not for production, so add gunicorn to requirements.txt.
Do I have to run migrate myself?
No. For a project laid out the way startproject lays it out, Livops runs manage.py migrate --noinput before every start. If it fails, the app still starts and the log says so, so a broken migration shows up in the deploy log rather than as a site that never comes up.
Why does my Django app answer 400 Bad Request?
Django refuses a host that ALLOWED_HOSTS does not name. Livops sets an ALLOWED_HOSTS variable to the project's addresses, its own and your domains, unless you set it yourself, but settings.py has to read it: ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",").
How are static files served?
With DEBUG off Django serves none. Add whitenoise right after SecurityMiddleware and set STATIC_ROOT; Livops then runs collectstatic during the build, and whitenoise serves the collected files from the same process.
Where should uploaded files go?
Not next to the code, which is read-only while the app runs. Use /app/data, whose path is in the DATA_DIR variable and survives deploys, or a storage bucket, whose S3 and AWS variables are written into the service for you.
How much does a Django app cost on Livops?
39 credits a month, which is 39,000 so'm at 1,000 so'm a credit. One 500 MB PostgreSQL database per team is free. There is no free tier for apps; on an account that has not paid yet, the first app runs for 15 minutes on a zero balance, once.
Who wrote this comparison?
The Livops team. Every price and limit of another provider on this page links to that provider's own page, with the day we read it.
Sources
- Django — Deployment checklist (docs.djangoproject.com). Checked .
- Django — django-admin and manage.py (runserver) (docs.djangoproject.com). Checked .
- Django — Settings (docs.djangoproject.com). Checked .
- WhiteNoise — Using WhiteNoise with Django (whitenoise.readthedocs.io). Checked .
- Gunicorn — Settings (gunicorn.org). Checked .
- Gunicorn — Design (gunicorn.org). Checked .
- SmartCloud — VDS plans (smartcloud.uz). Checked .
- Railway — Pricing (railway.com). Checked .
- Render — Pricing (render.com). Checked .
- Render — Deploy for free (render.com). Checked .
- Fly.io — Pricing (docs.fly.io). Checked .
- Render — Regions (render.com). Checked .
- Railway — Deployment regions (docs.railway.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Django appRelated
- DisallowedHost: Invalid HTTP_HOST header — Django's 400 Bad RequestDjango received a request for a host name that is not in ALLOWED_HOSTS, so it answered 400 Bad Request. Add the domain the site is served on to ALLOWED_HOSTS, without https:// and without a port, or read the list from an environment variable, and redeploy.
- Gunicorn "Worker failed to boot": what it means and how to fix itGunicorn's worker could not load your application, so the master process shut down. The cause is the Python traceback printed just above the message: most often a missing package or variable, or a wrong module:variable path in the gunicorn command. Fix what the traceback names and the workers boot.
- ModuleNotFoundError: No module named — after a deployPython searched sys.path and could not find the module you import. After a deploy that almost always means the package is not in requirements.txt, is listed under a different name than the one you import, or the start command runs a Python that the packages were not installed into.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- FastAPI hosting in 2026: how to deploy a FastAPI app, and whereA FastAPI app in production runs on Uvicorn without --reload, listens on 0.0.0.0 and the platform's port, trusts the proxy's headers and runs its migrations before it starts. On Livops a repository with main.py and requirements.txt starts on Uvicorn from a push, for 39 credits a month (39,000 so'm). Here is how Render, Railway, Fly.io and a VPS compare.
- Flask hosting in 2026: how to deploy a Flask app, and whereA Flask app in production runs on a WSGI server such as Gunicorn, never on flask run, and is told it sits behind a proxy. On Livops a repository with app.py and requirements.txt that lists gunicorn starts on Gunicorn from a push, for 39 credits a month (39,000 so'm). Here is how Render, Railway, Fly.io and a VPS compare.