Skip to main content
PercherPercher

Deploy guide · runtime = "python"

Deploy Django on Percher

Django is Python's batteries-included web framework — ORM, admin, auth, migrations, templates. On Percher it ships on the Python runtime via Nixpacks with `gunicorn` as the WSGI server.

Why Percher fits

  • Long-running container model is what Django expects — no Lambda-style cold-start workarounds for the ORM, and Django's `runserver`-shaped lifecycle maps cleanly to one Percher container.
  • Point `DATABASE_URL` at any external Postgres provider (Neon, Supabase, your own) and Percher's outbound proxy handles the connection — works with `dj-database-url` out of the box.

Quick start

bunx percher create my-app --template django
cd my-app
bunx percher publish

The first command scaffolds a working Django project plus a `percher.toml`. Publish builds and deploys it; the live URL prints on completion.

percher.toml

The canonical config for a Django app on Percher. `bunx percher init` generates this automatically when it detects Django in your project.

[app]
name = "my-app"
runtime = "python"
framework = "django"

[web]
port = 8000
health = "/health/"

Common gotchas

  • Percher doesn't provision a managed Postgres today. Use an external provider (Neon/Supabase/your own) and set `DATABASE_URL` via `bunx percher env set DATABASE_URL=...`.
  • Set `ALLOWED_HOSTS` to include your `*.percher.run` subdomain and any custom domain, otherwise Django returns a 400 to every request.
  • `collectstatic` needs to run as part of the build, not at runtime — bake it into your `entrypoint.sh` or run it as a post-build step.
  • `gunicorn config.wsgi:application -b 0.0.0.0:${PORT}` is the canonical start command. Bind to `0.0.0.0`, not `localhost`.

Related docs

Ready to deploy Django?

Free plan, no credit card. Live in under a minute.

Sign up free

← Browse all deploy guides