8000 [soc2010/app-loading] initialize cache and check for errors when sett… · ddriddle/django@574424f · GitHub
[go: up one dir, main page]

Skip to content

Commit 574424f

Browse files
committed
[soc2010/app-loading] initialize cache and check for errors when setting up the environment
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 5e17e83 commit 574424f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

django/core/management/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def get_commands():
9797

9898
# Find the installed apps
9999
try:
100-
from django.conf import settings
101-
apps = settings.INSTALLED_APPS
100+
from django.core.apps import cache
101+
apps = cache.installed_apps
102102
except (AttributeError, EnvironmentError, ImportError):
103103
apps = []
104104

@@ -419,6 +419,12 @@ def setup_environ(settings_mod, original_settings_path=None):
419419
project_module = import_module(project_name)
420420
sys.path.pop()
421421

422+
# Initialize the appcache and look for errors
423+
from django.core.apps import cache
424+
for (app_name, error) in cache.get_app_errors().items():
425+
sys.stderr.write("%s: %s" % (app_name, error))
426+
sys.exit(1)
427+
422428
return project_directory
423429

424430
def execute_from_command_line(argv=None):

0 commit comments

Comments
 (0)
0