diff -r a65502e8c7e6 django/core/management/__init__.py
a
|
b
|
|
66 | 66 | return getattr(__import__('%s.management.commands.%s' % (app_name, name), |
67 | 67 | {}, {}, ['Command']), 'Command')() |
68 | 68 | |
| 69 | def _import(name): |
| 70 | mod = __import__(name) |
| 71 | components = name.split('.') |
| 72 | for comp in components[1:]: |
| 73 | mod = getattr(mod, comp) |
| 74 | return mod |
| 75 | |
69 | 76 | def get_commands(): |
70 | 77 | """ |
71 | 78 | Returns a dictionary mapping command names to their callback applications. |
… |
… |
|
104 | 111 | # Find the project directory |
105 | 112 | try: |
106 | 113 | from django.conf import settings |
107 | | project_directory = setup_environ(__import__(settings.SETTINGS_MODULE)) |
| 114 | project_directory = setup_environ(_import(settings.SETTINGS_MODULE)) |
108 | 115 | except (AttributeError, EnvironmentError, ImportError): |
109 | 116 | project_directory = None |
110 | 117 | |