How it works
The blueprint creates the web service and a Postgres database. SECRET_KEY is generated once, and DATABASE_URL points at the database over the private network. The build collects static files, preDeployCommand runs migrate before every deploy goes live (a failing migration stops the deploy and the old version keeps serving), and gunicorn binds to $PORT. ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS come from REBASABLE_EXTERNAL_URL.
Run it locally
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver # SQLite when DATABASE_URL is not set
Use it as your own repository
Copy the django folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.
Good to know
- Create an admin user: open a shell on the service (Shell tab in the dashboard, or
rebasable ssh) and runpython manage.py createsuperuser. - Custom domain: add it in the dashboard and set
EXTRA_ALLOWED_HOSTS=www.example.com. - The free database has 1 GB and no daily backups. Paid plans add backups and more space.