1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #21829 -- Added default AppConfigs.

Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
This commit is contained in:
Aymeric Augustin
2014-01-24 22:43:00 +01:00
parent 29ddae7436
commit 2ff93e027c
36 changed files with 194 additions and 111 deletions

View File

@@ -44,7 +44,7 @@ ALWAYS_INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.comments',
'django.contrib.admin',
'django.contrib.admin.apps.SimpleAdminConfig',
'django.contrib.admindocs',
'django.contrib.staticfiles',
'django.contrib.humanize',
@@ -168,12 +168,11 @@ def setup(verbosity, test_labels):
for label in test_labels_set)
installed_app_names = set(get_installed())
if module_found_in_labels:
if module_found_in_labels and module_label not in installed_app_names:
if verbosity >= 2:
print("Importing application %s" % module_name)
# HACK.
if module_label not in installed_app_names:
settings.INSTALLED_APPS.append(module_label)
settings.INSTALLED_APPS.append(module_label)
app_config = AppConfig.create(module_label)
apps.app_configs[app_config.label] = app_config
app_config.import_models(apps.all_models[app_config.label])