# Django on Fly.io

Canonical: https://inetgeek.com/stacks/django-on-fly-io/

Fly.io 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 Fly.io publishes about each. Fly.io documents 4 of the 4.

| Requirement | Fly.io | Why it matters |
| --- | --- | --- |
| Persistent processes | Supported — A stopped or suspended Machine still bills for its root filesystem at $0.15 per GB per month. | 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 | Supported | Django opens a database connection per worker. Without pooling, a modest traffic spike exhausts Postgres connection slots long before it exhausts CPU. |
| Scheduled jobs | Limited | 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://docs.fly.io/about/billing/
- Managed databases source: https://docs.fly.io/about/pricing/
- Managed connection pooling source: https://fly.io/docs/mpg/cluster-configuration/
- Scheduled jobs source: https://fly.io/docs/machines/flyctl/fly-machine-run/

## What Fly.io documents

> Fly.io is a great place to run your Django application. fly launch can detect, configure and deploy Django apps.

Source: https://fly.io/docs/django/

### Django features on Fly.io

- **background_workers**: Supported — Process groups are a way to configure a single Fly App to run multiple different programs. [...] Every defined process runs in its own Fly Machine(s) within the app, which means they don't compete for resources, and they can be scaled by process group. ([source](https://fly.io/docs/apps/processes/))
- **scheduled_jobs**: Limited — --schedule string Schedule a Machine run at hourly, daily, weekly and monthly intervals ([source](https://fly.io/docs/flyctl/machine-run/))
- **persistent_disk**: Supported — The root file systems of a Fly Machine are ephemeral and should only be used for temporary data, application code, and runtime files that can be rebuilt from scratch during deployments or restarts. [...] Use volumes to store your database files, to save your app's state, such as configuration and session or user data, or for any information that needs to persist after deploy or restart. ([source](https://fly.io/docs/volumes/overview/))
- **connection_pooling**: Supported — Your MPG plan determines the CPU and Memory configuration for your cluster. All plans include high availability, backups, and connection pooling. ([source](https://fly.io/docs/mpg/))
- **one_off_commands**: Supported — To SSH into your hosted Django application use the command fly ssh console. [...] The --pty flag tells the SSH server to run the command in a pseudo-terminal, which createsuperuser requires. ([source](https://fly.io/docs/django/getting-started/existing/))

## What it costs to run there

|  | Fly.io |
| --- | --- |
| Pricing model | Usage-based, no compute plan tiers; billing is pro-rated for the time resources are provisioned. |
| When you exceed a cap | No plan cap to exceed — Fly bills per second for provisioned resources. The only documented enforcement is unspecified automated scaling limits, which surface as an error message (platform-wide, all plans) |
| Regions | 17 regions |

- Pricing model source: https://fly.io/docs/about/pricing/
- When you exceed a cap source: https://fly.io/docs/about/pricing/
- Regions source: https://docs.fly.io/reference/regions/

## Whether it suits you

Workloads that ship as Docker images and need placement in particular regions. Billing is purely usage-based with no plan tiers, which suits spiky or region-pinned traffic better than a flat monthly fee.

Consider something else if: You want a predictable flat bill rather than charges that track the resources provisioned for each app.

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/
- Fly.io: https://inetgeek.com/hosting/fly-io/
