Skip to content
Snippets Groups Projects
Commit d1b26248 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

add an ansible task to set DJANGO_SETTINGS_MODULE in wsgi handler script

this seems to be a shortcoming of mod_wsgi-express, which does not save
this var from the call to a line such as:
"./manage.py runmodwsgi --setup-only --settings=XXX"


Former-commit-id: 082479fde709b689a38e670927c367f0af29ca73
parent 223a9ac9
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,12 @@ ...@@ -77,6 +77,12 @@
command: "runmodwsgi --setup-only --port=80 --user ippidb --group wheel --server-root=/etc/ippidb-80" command: "runmodwsgi --setup-only --port=80 --user ippidb --group wheel --server-root=/etc/ippidb-80"
app_path: "/home/{{ deploy_user_name }}/iPPIDB/ippisite" app_path: "/home/{{ deploy_user_name }}/iPPIDB/ippisite"
settings: "ippisite.{{ ansible_hostname }}_settings" settings: "ippisite.{{ ansible_hostname }}_settings"
- name: add line in generated WSGI handler script to set DJANGO_SETTINGS_MODULE
blockinfile:
path: /etc/ippidb-80/handler.wsgi
insertafter: "os.environ['MOD_WSGI_SERVER_ALIASES'] = None or ''"
content: |
os.environ['DJANGO_SETTINGS_MODULE'] = 'ippisite.{{ ansible_hostname }}_settings'
- name: create or update database - name: create or update database
become_user: "{{ deploy_user_name }}" become_user: "{{ deploy_user_name }}"
django_manage: django_manage:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment