summaryrefslogtreecommitdiff
path: root/src/server/management
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-09-15 08:00:29 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-09-15 08:00:29 +1000
commit1242f836f8fbcbf9abc674c30774d4377fa09154 (patch)
treefc40bddaa699f4baa673550fbb4964858d35b4f4 /src/server/management
parentcc3c0395d551bfc9a54de56d0120d87ac53fb5d7 (diff)
parentef1117a85e84c70cac03e829a8c133c74184cc62 (diff)
downloadmod_wsgi-4.3.0.tar.gz
Merge branch 'release/4.3.0'4.3.0
Diffstat (limited to 'src/server/management')
-rw-r--r--src/server/management/commands/runmodwsgi.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/server/management/commands/runmodwsgi.py b/src/server/management/commands/runmodwsgi.py
index b80541e..ad7cd8e 100644
--- a/src/server/management/commands/runmodwsgi.py
+++ b/src/server/management/commands/runmodwsgi.py
@@ -29,7 +29,16 @@ class Command(BaseCommand):
args = [script_file]
options['callable_object'] = callable_object
- options['working_directory'] = settings.BASE_DIR
+ # If there is no BASE_DIR in Django settings, assume that
+ # the current working directory is the parent directory of
+ # the directory the settings module is in.
+
+ if hasattr(settings, 'BASE_DIR'):
+ options['working_directory'] = settings.BASE_DIR
+ else:
+ settings_mod = sys.modules[os.environ['DJANGO_SETTINGS_MODULE']]
+ parent = os.path.dirname(os.path.dirname(settings_mod.__file__))
+ options['working_directory'] = parent
url_aliases = options.setdefault('url_aliases') or []