coltrane can be installed with deployment features for production by installing the deploy extras.

poetry add coltrane -E deploy


If using pip you can do something like: pip install coltrane[deploy].

Required settings



gunicorn is a production WSGI server and is perfect for serving coltrane apps.

An example command for using gunicorn in production: poetry run gunicorn -b localhost:8000 app:wsgi.


whitenoise allows regular WSGI servers to serve static files without needing to move assets to S3 or another hosted file platform. It will be configured automatically when DEBUG is set to False.



A sample Dockerfile is created for new Coltrane projects. It can be used along with for any hosting platform that supports Docker.


Heroku will run the collectstatic management command by default for Django projects, but this should be disabled by setting the DISABLE_COLLECTSTATIC environment variable to 1. Add the nginx buildpack from

Then, add the following files so that nginx will serve the static files efficiently.

def when_ready(server):
    # touch app-initialized when ready
    open("/tmp/app-initialized", "w").close()

bind = "unix:///tmp/nginx.socket"
workers = 3


web: python collectstatic --noinput && bin/start-nginx gunicorn -c app:wsgi

  • Set the PYTHON_VERSION environment variable to the desired Python version (must be at least 3.8) Python version

  • Go to settings and use pip install poetry && poetry install && poetry run coltrane build for the Build Command build command