Browse Source

Only run wsgi initialization once

pull/160/head
Mike Olund 8 years ago
parent
commit
df24ef6d70
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      wsgi.py

+ 8
- 4
wsgi.py View File

@ -16,9 +16,13 @@ if not os.environ.get('OPENSHIFT_BUILD_NAMESPACE', False):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.local")
else:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.openshift")
# compress the static assets
execute_from_command_line(['manage.py', 'compress', '--force'])
# load the Question fixture
execute_from_command_line(['manage.py', 'loaddata', '/opt/app-root/src/edivorce/fixtures/Question.json'])
if os.environ.get('POD_INIT_COMPLETE', "") != "True":
# compress the static assets
execute_from_command_line(['manage.py', 'compress', '--force'])
# load the Question fixture
execute_from_command_line(['manage.py', 'loaddata', '/opt/app-root/src/edivorce/fixtures/Question.json'])
os.environ["POD_INIT_COMPLETE"] = "True"
application = get_wsgi_application()

Loading…
Cancel
Save