From ecc72f4191fd2761ca7f03e5fb845ed332748d75 Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Tue, 26 Jun 2018 09:33:13 -0700 Subject: [PATCH] Add support for debugging on Windows. --- wsgi.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wsgi.py b/wsgi.py index 821721af..30e572d4 100644 --- a/wsgi.py +++ b/wsgi.py @@ -8,9 +8,10 @@ https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os +import platform from django.core.wsgi import get_wsgi_application from django.core.management import execute_from_command_line - + # check if the app is running on OpenShift if not os.environ.get('OPENSHIFT_BUILD_NAMESPACE', False): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "edivorce.settings.local") @@ -23,7 +24,14 @@ else: os.environ["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']) + + +question_fixture_path = '/opt/app-root/src/edivorce/fixtures/Question.json' +platform_name = platform.system() +if platform_name == "Windows": + question_fixture_path = os.path.realpath("./edivorce/fixtures/Question.json") + +# load the Question fixture +execute_from_command_line(['manage.py', 'loaddata', question_fixture_path]) application = get_wsgi_application()