Deploy guide

Deploy a Django app on Gheima

Connect the project's GitHub or GitLab repository and create a web service. Gheima builds it with Nixpacks, which detects Django from `manage.py` and `requirements.txt` and serves it with gunicorn on the `PORT` Gheima sets. Link a managed Postgres database and run `python manage.py migrate` as the release command. It runs in Oracle Cloud's Casablanca region.

Deploy it

  1. 1

    Prepare the project

    Add gunicorn to requirements.txt, and add your gheima.ma address and your own domain to ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS.

  2. 2

    Create a web service from the repository

    Pick the repository and branch, and leave the build and start commands blank for Nixpacks to detect them. If settings.py has no WSGI_APPLICATION, Gheima fills it in from the module manage.py points at.

  3. 3

    Connect a database

    Create a managed Postgres database and link it to the service: DATABASE_URL, the DB_* variables and the PG* variables are set for you. Read DATABASE_URL in settings.py, for example with dj-database-url, and set the release command to python manage.py migrate.

  4. 4

    Add your domain

    Add the domain on the service, point its DNS at Gheima, and the HTTPS certificate is issued and renewed for you.

Read next

Questions

Where do uploaded media files go?

Not on the container's disk, which is replaced on every deploy. Store them in a managed storage bucket through the S3 API, for example with `django-storages`, or attach a persistent volume.

How do I run management commands?

Set a command as the release command to run it before each rollout, or run one-off commands from the CLI with `gheima run <service> -- python manage.py <command>`.

How much does it cost?

A Django app runs on the Free plan, where a web service sleeps after 30 minutes without traffic. Paid plans start at 90 MAD a month and keep it awake. The pricing page lists every limit.

Your next deploy is a git push away

New accounts are by invitation for now. Ask for an invite and we'll email you when we can let you in.