diff --git a/core/management/__init__.py b/core/management/__init__.py
index c4396d2..b8eca60 100644
a
|
b
|
def setup_environ(settings_mod, original_settings_path=None):
|
310 | 310 | project_directory, settings_filename = os.path.split(settings_mod.__file__) |
311 | 311 | if project_directory == os.curdir or not project_directory: |
312 | 312 | project_directory = os.getcwd() |
313 | | project_name = os.path.basename(project_directory) |
314 | 313 | |
315 | 314 | # Strip filename suffix to get the module name. |
316 | 315 | settings_name = os.path.splitext(settings_filename)[0] |
… |
… |
def setup_environ(settings_mod, original_settings_path=None):
|
319 | 318 | if settings_name.endswith("$py"): |
320 | 319 | settings_name = settings_name[:-3] |
321 | 320 | |
| 321 | if settings_name == '__init__': |
| 322 | # Settings is a module; thus the project directory and settings_name |
| 323 | # must be gleaned from one level higher up the path. |
| 324 | project_directory = os.path.dirname(project_directory) |
| 325 | settings_name = os.path.basename(os.path.dirname(settings_mod.__file__)) |
| 326 | |
| 327 | project_name = os.path.basename(project_directory) |
| 328 | |
322 | 329 | sys.path.append(os.path.join(project_directory, os.pardir)) |
323 | 330 | project_module = __import__(project_name, {}, {}, ['']) |
324 | 331 | sys.path.pop() |