Skip to content

For Django

Django hosting, done properly

Gunicorn or Uvicorn on a real VM, django-storages on an S3-compatible bucket and a CDN across 988 locations. The classic deployment, wired the way you'd do it yourself, only quicker.

Free to sign up. No egress fees on any product.

Why Django on Edge

PaaS convenience at VPS prices

No buildpacks, no dyno maths. A real Linux box for your Python environment, with the storage and delivery already wired in.
  • Gunicorn or Uvicorn on real VMs

    Run any WSGI or ASGI server (Gunicorn, Uvicorn, Granian or Daphne) on a VM sized to fit. RAM and CPU you can predict.
  • An S3 storage backend

    Point django-storages at Edge Storage and use it for both media and collected static files. It behaves exactly like AWS S3.
  • Postgres on a private network

    Run Postgres on the same VM or its own, joined by a free private network. Or keep your existing managed provider.
  • Thumbnails without the queue

    Skip sorl-thumbnail and its cache table. Request ?width=320&height=320&fit=cover from the CDN and it does the rest.
  • Global CDN, zero egress

    /static/ and /media/ cache in 988 locations. High hit rates on the files people actually load, and no bandwidth bill.
  • Agent-deployable

    Ask your coding agent to deploy the project to a domain. The agent API provisions the VM, sets up DNS and adds the CDN.

Reference architecture

How Django maps to Edge

Gunicorn on one VM, Postgres on another over a private network, static and media in a bucket, and the CDN in front of both.
  • Compute

    Runs Gunicorn (WSGI) or Uvicorn (ASGI) behind Nginx, and Postgres on its own VM.

  • Storage

    Backs django-storages for both the default and staticfiles storages.

  • CDN

    Caches /static/ and /media/ URLs worldwide.

  • Image optimisation

    On-the-fly thumbnails, crops and AVIF/WebP from uploaded media.

  • DNS

    Anycast DNS for the apex, www and admin subdomains.

  • Shield

    Checks auth and contact forms with one HTTP call from a view.

  • Assist

    One template include adds answers grounded in your site's content.

Deploy

From startproject to live in five steps

The deployment you already know: a Python VM, Postgres, S3 storage and a release script.
  1. 01

    Create the app and database VMs

    The python script installs Python 3.12, pip, Gunicorn and Nginx. The postgresql script sets up PostgreSQL 16. Join both to a private network so the database never faces the internet.

    shell
    $ edge compute create --name django --size s-2vcpu-4gb \
        --image ubuntu-24 --region london --script python
    
    $ edge compute create --name db --size s-2vcpu-4gb \
        --image ubuntu-24 --region london --script postgresql \
        --script-param db_name=acme
  2. 02

    Point django-storages at Edge Storage

    Use the STORAGES setting (Django 4.2 and later). A custom domain makes static and media URLs go through the CDN.

    settings.py
    S3 = "storages.backends.s3.S3Storage"
    STORAGES = {
        "default": {"BACKEND": S3, "OPTIONS": {"location": "media"}},
        "staticfiles": {"BACKEND": S3, "OPTIONS": {"location": "static"}},
    }
    AWS_S3_ENDPOINT_URL = "https://storage.edge.network"
    AWS_S3_REGION_NAME = "us-east-1"
    AWS_STORAGE_BUCKET_NAME = "acme-static"
    AWS_S3_CUSTOM_DOMAIN = "static.acme.io"
    AWS_ACCESS_KEY_ID = os.environ["EDGE_ACCESS_KEY"]
    AWS_SECRET_ACCESS_KEY = os.environ["EDGE_SECRET_KEY"]
  3. 03

    Run Gunicorn under systemd

    Nginx from the python script proxies to 127.0.0.1:8000. Swap in Uvicorn workers for ASGI.

    /etc/systemd/system/gunicorn.service
    [Unit]
    Description=Gunicorn for acme
    After=network.target
    
    [Service]
    User=www-data
    WorkingDirectory=/srv/acme
    ExecStart=/srv/acme/.venv/bin/gunicorn acme.wsgi:application \
        --workers 4 --bind 127.0.0.1:8000
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
  4. 04

    Ship a release

    Pull, install, migrate, collect, restart. Wrap it in a CI job once it works by hand.

    shell
    $ git pull && .venv/bin/pip install -r requirements.txt
    $ .venv/bin/python manage.py migrate --noinput
    $ .venv/bin/python manage.py collectstatic --noinput
    $ sudo systemctl restart gunicorn
  5. 05

    Front it with the CDN

    One deployment, two hostnames: the app goes to the VM, static and media come from the bucket.

    shell
    $ edge cdn create --name acme
    $ edge cdn domains add cdn-61f0a8 \
        --domain app.acme.io --origin https://<vm-ip>
    $ edge cdn domains add cdn-61f0a8 --domain static.acme.io \
        --origin-type storage --storage-bucket acme-static --jit-image

Prefer to hand it off? Give the job to your AI agent or have our engineers do it.

What it costs

Two VMs, one bucket, no dyno maths

An app server and a database server, each with its own CPU and memory. Static and media ride the CDN for pennies.
  • The private network between VMs is free
  • No egress fees on static files or media
  • Thumbnails included with the CDN
  • Billed hourly from a prepaid balance, with optional hard caps
See compute pricing

Estimated monthly bill on Edge

Production app · 4.5M requests a month · 65 GB of media

USD
  • App VM$19.24Standard VM · 2 vCPU · 4 GiB · Gunicorn + Nginx
  • Database VM$19.24Standard VM · 2 vCPU · 4 GiB · PostgreSQL 16
  • CDN$1.004.5M requests: first 500k free, 4M × $0.25 per million
  • Storage$0.9065 GB of static and media: first 5 GB free, 60 GB × $0.015
  • DNS$0.00Apex, www and admin records
  • Egress$0.00
Total$40.38

FAQ

Django on Edge, answered

Something else? Ask an engineer.
WSGI or ASGI?
Either. Gunicorn for classic Django, Uvicorn or Daphne for ASGI and Channels. Both run as ordinary Python processes on an Edge VM behind Nginx or Caddy.
Where should Postgres run?
For small and medium loads, on the same VM. For larger ones, give it its own VM on a private network (free, same region) to keep latency low. Or point Django at your existing managed Postgres.
How do I deploy?
The usual: git pull, pip install, manage.py migrate, manage.py collectstatic, restart Gunicorn. Put those four commands in a CI job or a small deploy script.
Does the admin work behind the CDN?
Yes. Responses that set cookies or send Cache-Control: private are never cached, so the admin and logged-in pages go straight to Gunicorn. Add your domain to CSRF_TRUSTED_ORIGINS and set SECURE_PROXY_SSL_HEADER.
How does this compare with Heroku?
You get real CPU and disk, full control of the Python environment, and a bill that doesn't scale with dynos or add-ons. The trade-off is one bootstrap script, and the python library script is most of it.

Ship Django on Edge

Bring an existing project or start with django-admin startproject. We'll help you size the VMs.

Free tiers hard-cap. Nothing bills until you add a card.