Configuring Django Apps for Heroku
Last updated March 21, 2022
First, and most importantly, Heroku web applications require a
This file is used to explicitly declare your application’s process types and entry points. It is located in the root of your repository.
web: gunicorn myproject.wsgi
This Procfile requires Gunicorn, the production web server that we recommend for Django applications. For more information, see Deploying Python Applications with Gunicorn.
$ pip install gunicorn
Be sure to add
gunicorn to your
requirements.txt file as well.
On Heroku, sensitive credentials are stored in the environment as config vars. This includes database connection information (named
DATABASE_URL), which is traditionally hardcoded in Django applications.
We recommend you configure Django manually for now.