This is a Juju charm for setting up an Apache mod_wsgi server for a basic Python WSGI app.
juju deploy ~nottrobin/trusty/apache2-wsgi
The charm will just show a basic Apache2 welcome page, until you give it a URL from which to download a correctly configured WSGI app:
juju set app_tgz_url=http://example.com/my-project.tgz
It will then download the project, extract it, and restart Apache, attempting to run it.
If your app wants to make use of a MongoDB server, you can do that by adding a relation:
juju deploy mongodb
juju add-relation apache-wsgi mongodb
Now the MongoDB URI for your application to use will be available in the environment variable MONGODB_URI
.
By default, the WSGI file (wsgi_file_path
) is expected to be at [project]/app.py
, and the application name (wsgi_app_name
) is expected to be app
. This is in line with Flask defaults.
Any required python modules should be listed in [project]/requirements.txt
(pip_requirements_path
) and if you want pip to install them from local files instead of from PyPi, include the local packages in [project]/pip-cache
(pip_cache_path
).
For a full list of configuration options, see config.yaml
.