# Django on Heroku

Canonical: https://inetgeek.com/stacks/django-on-heroku/

Heroku publishes its own guide for deploying Django.

Python web framework with an ORM, admin interface and long-running server process.

## What Django needs

Every host claims to run Django, so the claim on its own decides nothing. These are the things Django requires from the platform underneath it, and what Heroku publishes about each. Heroku documents 4 of the 4.

| Requirement | Heroku | Why it matters |
| --- | --- | --- |
| Persistent processes | Supported | Django is served by a WSGI or ASGI worker that stays up. Celery workers are a second long-running process alongside it. |
| Managed databases | Supported | Django's ORM, migrations and admin all assume a real relational database. Postgres is the default assumption in its own documentation. |
| Managed connection pooling | Limited | Django opens a database connection per worker. Without pooling, a modest traffic spike exhausts Postgres connection slots long before it exhausts CPU. |
| Scheduled jobs | Supported | Management commands are how Django does recurring work. With no scheduler you need a second service whose only job is to trigger them. |

- Persistent processes source: https://devcenter.heroku.com/articles/dynos
- Managed databases source: https://devcenter.heroku.com/articles/heroku-postgresql
- Managed connection pooling source: https://devcenter.heroku.com/articles/postgres-connection-pooling
- Scheduled jobs source: https://devcenter.heroku.com/articles/scheduler

## What Heroku documents

> This Procfile requires Gunicorn, the production web server that we recommend for Django applications.

Source: https://devcenter.heroku.com/articles/django-app-configuration

### Django features on Heroku

- **background_workers**: Supported — Celery is fully supported on Heroku and just requires using one of our add-on providers to implement the message broker and result store [...] You deploy Celery by running one or more worker processes. ([source](https://devcenter.heroku.com/articles/celery-heroku))
- **scheduled_jobs**: Supported — Scheduler is a free add-on for running jobs on your app at scheduled time intervals, much like cron in a traditional server environment. ([source](https://devcenter.heroku.com/articles/scheduler))
- **persistent_disk**: Not supported — Each dyno gets its own ephemeral filesystem, with a fresh copy of the most recently deployed code. [...] Any files written get discarded the moment the dyno stops or restarts, including automatic restarts. ([source](https://devcenter.heroku.com/articles/dynos))
- **connection_pooling**: Supported — Server-side connection pooling for Heroku Postgres helps applications use database connections efficiently to avoid reaching your database's plan connection limits. [...] Server-side connection pooling is available for Standard, Premium, Private, and Shield-tier databases. ([source](https://devcenter.heroku.com/articles/postgres-connection-pooling))
- **one_off_commands**: Supported — One-off dynos allow you to perform administrative or maintenance tasks for your app and are helpful for debugging. [...] Running a console or a REPL shell to run arbitrary code or inspect the app's models against the live database ([source](https://devcenter.heroku.com/articles/one-off-dynos))

## What it costs to run there

|  | Heroku |
| --- | --- |
| Entry paid plan | $5 per month (Eco dynos plan, 1000 dyno hours shared across the account) |
| Pricing model | Usage-based on wall-clock time, prorated to the second |
| When you exceed a cap | Service sleeps: on the Eco plan ($5/month for a 1000 dyno-hour pool, the cheapest paid tier) exhausting the pool forces every Eco dyno on the account to sleep for the rest of the month, and extra hours cannot be bought |
| Regions | 2 regions on the Common Runtime, which is what a standard dyno runs in: eu (Europe) and us (United States). A further 10 — Dublin, Frankfurt, London, Montreal, Mumbai, Oregon, Singapore, Sydney, Tokyo and Virginia — exist only in Private Spaces, an Enterprise product. |

- Entry paid plan source: https://devcenter.heroku.com/articles/eco-dyno-hours
- Pricing model source: https://devcenter.heroku.com/articles/usage-and-billing
- When you exceed a cap source: https://devcenter.heroku.com/articles/eco-dyno-hours
- Regions source: https://devcenter.heroku.com/articles/regions

## Whether it suits you

Teams that want to deploy by pushing to Git and let the platform handle the runtime, with Postgres, a scheduler and Docker deploys available on the same platform.

Consider something else if: The dyno filesystem is ephemeral, and a web process must respond within 30 seconds of receiving a request.

Written by Palash Bagchi on 2026-09-05. This is a recommendation, not a sourced fact — it carries no citation because it is an opinion.

## Related

- Best hosting for Django: https://inetgeek.com/stacks/django/
- Heroku: https://inetgeek.com/hosting/heroku/
