/nanobox-engine-python

Generic engine for running Python apps

Primary LanguageShellMozilla Public License 2.0MPL-2.0

Python

This is a generic Python engine used to launch Python web and worker services when using Nanobox.

App Detection

To detect a Python app, this engine looks for a requirements.txt.

Build Process

  • Installs virtualenv to create an isolated Python environment in which to build code.
  • In the Python environment, the engine installs requirements by running pip install -r requirements.txt. Requirements are installed in the project rather than globally.

Important Things to Know

Basic Configuration Options

This engine exposes configuration options through the Boxfile, a yaml config file used to provision and configure your app's infrastructure when using Nanobox.

Advanced Configuration Options

This Readme outlines only the most basic and commonly used settings. For the full list of available configuration options, view the Advanced Python Configuration options.

Overview of Basic Boxfile Config Options

build:
  runtime: python27
  js_runtime: nodejs-0.12
  app_module: ''
Quick Links

Pyton Settings
JS Runtime Settings
Gunicorn Settings

Python Settings

The following setting allows you to define your Python runtime environment.


runtime

Specifies which Python runtime and version to use. The following runtimes are available:

  • python27
  • python 34
build:
  runtime: python27

JS Runtime Settings

Many applications utilize Javascript tools in some way. This engine allows you to specify which JS runtime you'd like to use.


js_runtime

Specifies which JS runtime and version to use. The following runtimes are available:

  • nodejs-0.8
  • nodejs-0.10
  • nodejs-0.12
  • iojs-2.3
build:
  js_runtime: nodejs-0.12

Gunicorn Settings

The following settings allow you to configure Gunicorn.


app_module

Of the pattern $(MODULE_NAME):$(VARIABLE_NAME). The module name can be a full dotted path. The variable name refers to a WSGI callable that should be found in the specified module.

# Example
build:
  app_module: 'test:app'

Help & Support

This is a generic (non-framework-specific) Python engine provided by Nanobox. If you need help with this engine, you can reach out to us in the #nanobox IRC channel. If you are running into an issue with the engine, feel free to create a new issue on this project.