Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

Before we can deploy a Python app to anynines we have to take care of some preparations. In this post I’d like to demonstrate the Python application deployment prerequisites and process using the example of a simple Django application. The demo application’s source code can be found on github.

Prerequisites

Configure environment

At first we have to ensure that our desired Python version is specified in the runtime.txt file.

In addition we need to specify our dependencies within the requirements.txt file.

Hint: You can use the pip freeze command to show a list of installed packages

The Python buildpack uses a Procfile in the root directory of your application specifying the app’s start command

Adjust deployment manifest

Anynines uses so called manifest files to specify deployment details for applications. The example application contains an example manifest.yml file.

The most important lines within this file are the application name, the application host and the buildpack url pointing to the heroku python buildpack .

Deployment

As we prepared our application environment and deployment configuration with our manifest file, we are ready to deploy the app to anynines by running the push command from our application’s root directory:

$>cf target # verify that we are in the correct organization and space

The CLI will output logs during each step of the deployment process informing of the currently executed tasks. After finishing the staging phase your application will transferred to a container and started using the Procfile’s start command.

-----> Downloaded app package (12K)

Cloning into '/tmp/buildpacks/heroku-buildpack-python'...

-----> Installing runtime (python-3.4.1)

-----> Installing dependencies with pip

Downloading/unpacking Django==1.7 (from -r requirements.txt (line 1))

At the end of the deployment process the current state of your application along with other information like the RAM usage and bound urls is displayed. You can copy the link and try your application running on anynines.