summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Koziel <arthur@arthurkoziel.com>2010-09-10 22:44:44 +0000
committerArthur Koziel <arthur@arthurkoziel.com>2010-09-10 22:44:44 +0000
commit574424f40d26eff89a05c8e7664646a5a349514e (patch)
treeaa3da784403c55557dc59cbbe6bd69c91e324fe2
parent5e17e835a073d489d6325ea540c29a86bb18fc38 (diff)
downloaddjango-574424f40d26eff89a05c8e7664646a5a349514e.tar.gz
[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
-rw-r--r--django/core/management/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 32e744374a..a61b648674 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -97,8 +97,8 @@ def get_commands():
# Find the installed apps
try:
- from django.conf import settings
- apps = settings.INSTALLED_APPS
+ from django.core.apps import cache
+ apps = cache.installed_apps
except (AttributeError, EnvironmentError, ImportError):
apps = []
@@ -419,6 +419,12 @@ def setup_environ(settings_mod, original_settings_path=None):
project_module = import_module(project_name)
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
def execute_from_command_line(argv=None):