diff options
| author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2014-09-15 08:00:29 +1000 |
|---|---|---|
| committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2014-09-15 08:00:29 +1000 |
| commit | 1242f836f8fbcbf9abc674c30774d4377fa09154 (patch) | |
| tree | fc40bddaa699f4baa673550fbb4964858d35b4f4 /src/server/management | |
| parent | cc3c0395d551bfc9a54de56d0120d87ac53fb5d7 (diff) | |
| parent | ef1117a85e84c70cac03e829a8c133c74184cc62 (diff) | |
| download | mod_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.py | 11 |
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 [] |
