§ 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 latest python-2.7 and python-3.4 are officially supported, but any runtime between 2.4.4–3.4.1 can be used, including PyPy runtimes. See the buildpack’s GitHub page for a full list.

§ 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 -