Skip to main content
Django runs on slipway as a web service on the Python runtime, with a managed Postgres alongside it.

Prerequisites

A Django project in a GitHub or GitLab repository, with gunicorn in your requirements.

Configure the app

Django rejects requests whose Host header is not in ALLOWED_HOSTS, which otherwise shows up as a 403 on a deploy that looks healthy.
settings.py

Add slipway.yaml

slipway.yaml
Replace myproject with your project package. preDeploy runs migrations in the freshly built image before the rollout, and the deploy proceeds only if it exits 0.

Set the secret

Before the first deploy, add DJANGO_SECRET_KEY under the project’s Settings → Variables & secrets. A reference nothing satisfies leaves the key unset and records a warning in the deploy log, so set the value first to start with it in place.

Add a health check endpoint

urls.py
Keep it cheap. A health check that queries the database fails the deploy whenever the database is slow.

Static files

For WhiteNoise, collect during the build:
slipway.yaml
For user uploads, use object storage rather than the container filesystem, which is lost on every deploy.

Add a worker

slipway.yaml
With a Redis broker:
slipway.yaml

Next steps

Postgres

Credentials, backups and external access.

Troubleshooting

What to check when a deploy goes wrong.