1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Populated the app registry earlier at startup.

Refs #1796, #21676.
This commit is contained in:
Aymeric Augustin
2013-12-30 11:12:40 +01:00
parent d6dc88cbc1
commit 0d2c8ff2be
4 changed files with 19 additions and 13 deletions

View File

@@ -344,11 +344,9 @@ class AppCommand(BaseCommand):
from django.apps import apps
if not app_labels:
raise CommandError("Enter at least one application label.")
# Populate models and don't use only_with_models_module=True when
# calling get_app_config() to tell apart missing apps from apps
# without a model module -- which can't be supported with the legacy
# API since it passes the models module to handle_app().
apps.populate_models()
# Don't use only_with_models_module=True in get_app_config() to tell
# apart missing apps from apps without a model module -- which can't
# be supported with the legacy API since it passes the models module.
try:
app_configs = [apps.get_app_config(app_label) for app_label in app_labels]
except (LookupError, ImportError) as e: