Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
Georg Bauer authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 django/bin/django-admin.py
16 django/bin/django-admin.py
View
@@ -3,14 +3,6 @@
from optparse import OptionParser
import os, sys
-# switch to english, because django-admin creates database content
-# like permissions, and those shouldn't contain any translations
-try:
- from django.utils import translation
- translation.activate('en-us')
-except:
- pass
-
ACTION_MAPPING = {
'adminindex': management.get_admin_index,
'createsuperuser': management.createsuperuser,
@@ -80,6 +72,14 @@ def main():
parser.print_usage_and_exit()
if not ACTION_MAPPING.has_key(action):
print_error("Your action, %r, was invalid." % action, sys.argv[0])
+
+ # switch to english, because django-admin creates database content
+ # like permissions, and those shouldn't contain any translations.
+ # But only do this if we should have a working settings file.
+ if action not in ('startproject', 'startapp'):
+ from django.utils import translation
+ translation.activate('en-us')
+
if action in ('createsuperuser', 'init', 'validate'):
ACTION_MAPPING[action]()
elif action == 'inspectdb':
Please sign in to comment.
Something went wrong with that request. Please try again.