Deploying to Heroku

This document assumes you have followed our Quick Start guide.

First, create a Heroku app:

heroku create

Set the buildpack for the app to use Python:

heroku buildpacks:set git://

Setting the buildpack explicitly is required due to the buildpack detection ordering. Our projects include a package.json file which will trick Heroku in thinking your project is a Node.js app. It should identify it as a Python app.

Setting up your project

In your project add the following to your requirements.txt:


Create a file named Procfile in your project with the following content:

web: gunicorn --log-file - mysite.wsgi

In your change:

    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": "dev.db",


import dj_database_url
    "default": dj_database_url.config()

In your mysite/ change:

application = get_wsgi_application()


from dj_static import Cling, MediaCling
application = Cling(MediaCling(get_wsgi_application()))

Commit to git

Add everything to git and commit:

git add .
git commit -m "added Heroku support"

Deploy to Heroku

To deploy to Heroku you use git:

git push heroku master

Run migrations:

heroku run python migrate