§ Python

Python is supported by the Python buildpack.

§ Detection

The Python buildpack is used if the repository contains a requirements.txt file. Django applications are detected by the presence of a manage.py file. If the manage.py file is found, manage.py collectstatic is run during the compilation process.

§ Dependencies

Dependencies are managed using pip. Dependencies are specified in a requirements.txt file. For example:


§ Specifying a Runtime

Deploys default to a recent version of Python 2.7. A different runtime version can be specified by providing a runtime.txt file, such as:


§ Supported Runtimes

The Python buildpack supports both the latest Python 2 and Python 3 runtimes, as well as PyPy runtimes. See the list of supported runtimes at the buildpack’s GitHub page.

§ Default Process Types

No default process types are defined for this buildpack, so a Procfile is needed. To deploy Gunicorn, for example, your Procfile might look like this:

web: gunicorn hello:app --log-file -