App Platform Python Buildpack

Python

heroku-buildpack-python is utilized as the buildpack for detecting and building your Python applications.

You can view the README for a full list of configuration options available to the buildpack.

Detection

A python app is detected based on the existence of one of the following files at the root directory of your source code:

requirements.txt
Pipfile
setup.py

Customization

Python Version

You can configure the python version used at runtime by specifying a runtime.txt file at the root of your source code:

python-3.9.2

Limitations

  • At least one of requirements.txt, Pipfile, and setup.py must be located in the root directory of the repo.
  • A run command is required. If one is not auto-detected, you must set one before deploying your app.
  • Gunicorn crashes with PermissionError unless launched with a specific argument due to an issue with Gunicorn running in Docker. To resolve, run Gunicorn to use a different location for its temp files by passing this option to the run command: gunicorn --worker-tmp-dir /dev/shm project.wsgi