=== modified file 'django/core/management/__init__.py'
|
|
|
302 | 302 | project_directory, settings_filename = os.path.split(settings_mod.__file__) |
303 | 303 | if project_directory == os.curdir or not project_directory: |
304 | 304 | project_directory = os.getcwd() |
305 | | project_name = os.path.basename(project_directory) |
| 305 | # Determine project name by splitting settings mod name if settings specified with project |
| 306 | # It will be "abc" in case of "abc.settings", "a.b" in case of "a.b.settings" and |
| 307 | # dirname of settings.py in case of "settings" |
| 308 | if '.' in settings_mod.__name__: |
| 309 | project_name = settings_mod.__name__[:settings_mod.__name__.rfind('.')] |
| 310 | else: |
| 311 | project_name = os.path.basename(project_directory) |
| 312 | |
306 | 313 | settings_name = os.path.splitext(settings_filename)[0] |
307 | 314 | sys.path.append(os.path.join(project_directory, os.pardir)) |
308 | 315 | project_module = __import__(project_name, {}, {}, ['']) |