Commits

art...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed e1b4cf4

[soc2010/app-loading] initialize cache and check for errors when setting up the environment

  • Participants
  • Parent commits 2c3fb4e
  • Branches soc2010/app-loading

Comments (0)

Files changed (1)

File django/core/management/__init__.py

 
         # 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 = []
 
     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):