Heroku Python Support
Last updated 22 May 2018
All versions of all known web frameworks (e.g. Django, Flask, Pyramid, etc) are fully supported on Heroku.
For a tutorial, see Getting Started with Python on Heroku.
The Heroku Python Support will be applied to applications only when the application has a
requirements.txt in the root directory.
When a deployed application is recognized as a Python application, you’ll see this in the build output:
$ git push heroku master -----> Python app detected
Supported Python Runtimes
Newly created Python applications default to the
You can specify the runtime
python-2.7.15, if you wish, with a
$ cat Pipfile … [requires] python_full_version = "2.7.15"
You can also specify a Python version with a
python-3.6.5on all (
heroku-18) runtime stacks
Pipfile is provided, the following command is run on your app to resolve dependencies:
$ pipenv install --system --deploy
requirements.txt file is provided, the following command is run on your app to resolve dependencies:
$ pip install -r requirements.txt
For Django applications, a Heroku Postgres
hobby-dev database is automatically provisioned. This populates the
DATABASE_URL environment variable.
No add-ons are automatically provisioned, otherwise. If you need a SQL database for your app, add one explicitly:
$ heroku addons:create heroku-postgresql:hobby-dev