Resources for Developers

Python

The Python language is officially supported on the platform.

Detection

To ensure our deployment system considers your application as a Python application, a file requirements.txt or setup.py should be present at the root of your project, defining the dependencies of your app.

Versions

Python 2 and Python 3 are both completely supported, you can specify the runtime version in the runtime.txt file at the root of your repository.

Example of runtime.txt which would install Python 3.6.4:

python-3.6.4

Frameworks

We handle most of the common frameworks. Obviously, Django is among them. You just need to configure your application to bind the port defined by the environment variable $PORT.

Supported Versions

  • 3.6.4
  • 2.7.14

Specific Python Buildpack Hooks

You may want to trigger custom actions after a successful deployment. The postdeploy hook is exactly what you need. But your application may require some actions to be executed during the deployment.

The Python buildpack can execute two hooks: before and after the installation of Python and its dependencies. They must be located in the bin root folder of your application and be named pre_compile and post_compile.

Buildpack

More information at https://github.com/Scalingo/python-buildpack.


mode_edit Suggest edits