1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

[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
This commit is contained in:
Arthur Koziel 2010-09-10 22:44:44 +00:00
parent 5e17e835a0
commit 574424f40d

View File

@ -97,8 +97,8 @@ def get_commands():
# Find the installed apps # Find the installed apps
try: try:
from django.conf import settings from django.core.apps import cache
apps = settings.INSTALLED_APPS apps = cache.installed_apps
except (AttributeError, EnvironmentError, ImportError): except (AttributeError, EnvironmentError, ImportError):
apps = [] apps = []
@ -419,6 +419,12 @@ def setup_environ(settings_mod, original_settings_path=None):
project_module = import_module(project_name) project_module = import_module(project_name)
sys.path.pop() sys.path.pop()
# Initialize the appcache and look for errors
from django.core.apps import cache
for (app_name, error) in cache.get_app_errors().items():
sys.stderr.write("%s: %s" % (app_name, error))
sys.exit(1)
return project_directory return project_directory
def execute_from_command_line(argv=None): def execute_from_command_line(argv=None):