Add support for adding environment variables

This commit is contained in:
Dorian 2015-03-24 08:05:57 -04:00
parent 48ec3aead6
commit 9adc044f1a
3 changed files with 8 additions and 0 deletions

View File

@ -69,6 +69,9 @@ into sections and described below:
- app_uwsgi_executable:
- The method executed by UWSGI to create a WSGI running app. Usually a WSGI factory method or module in the app.
- Default: app:make_wsgi_app()
- app_uwsgi_envs:
- (Optional) A dictionary of environment variables to pass into an app.
- Default: empty dictionary
### General Web:

View File

@ -15,3 +15,4 @@ app_nginx_static_path: "{{ app_root_path }}/{{ app_name }}/static/"
# UWSGI
app_uwsgi_port: 8000
app_uwsgi_executable: "app:make_wsgi_app()"
app_uwsgi_envs: {}

View File

@ -6,3 +6,7 @@ processes = 8
chdir = {{ app_root_path }}
virtualenv = {{ app_venv }}
module = {{ app_uwsgi_executable }}
{% for env_var, env_value in app_uwsgi_envs.items() %}
env = {{ env_var | upper }}={{ env_value }}
{% endfor %}