Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix a problem that masks errors in settings files for some users - in…

… those cases you only got "INSTALLED_APPS not defined", but in reality your settings file was broken.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6004fe9573e053faf3fc44bd895cc08c6e848267 1 parent 1873c95
authored November 11, 2005

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  django/bin/django-admin.py
16  django/bin/django-admin.py
@@ -3,14 +3,6 @@
3 3
 from optparse import OptionParser
4 4
 import os, sys
5 5
 
6  
-# switch to english, because django-admin creates database content
7  
-# like permissions, and those shouldn't contain any translations
8  
-try:
9  
-    from django.utils import translation
10  
-    translation.activate('en-us')
11  
-except:
12  
-    pass
13  
-
14 6
 ACTION_MAPPING = {
15 7
     'adminindex': management.get_admin_index,
16 8
     'createsuperuser': management.createsuperuser,
@@ -80,6 +72,14 @@ def main():
80 72
         parser.print_usage_and_exit()
81 73
     if not ACTION_MAPPING.has_key(action):
82 74
         print_error("Your action, %r, was invalid." % action, sys.argv[0])
  75
+
  76
+    # switch to english, because django-admin creates database content
  77
+    # like permissions, and those shouldn't contain any translations.
  78
+    # But only do this if we should have a working settings file.
  79
+    if action not in ('startproject', 'startapp'):
  80
+        from django.utils import translation
  81
+        translation.activate('en-us')
  82
+
83 83
     if action in ('createsuperuser', 'init', 'validate'):
84 84
         ACTION_MAPPING[action]()
85 85
     elif action == 'inspectdb':

0 notes on commit 6004fe9

Please sign in to comment.
Something went wrong with that request. Please try again.