summaryrefslogtreecommitdiff
path: root/django/bin/django-admin.py
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-11-11 23:34:08 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-11-11 23:34:08 +0000
commit6004fe9573e053faf3fc44bd895cc08c6e848267 (patch)
tree2b54f86cb06954b2bd874a573e610267376267d1 /django/bin/django-admin.py
parent1873c95b3134688e9e724caa6d3ce664160dd47c (diff)
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
Diffstat (limited to 'django/bin/django-admin.py')
-rwxr-xr-xdjango/bin/django-admin.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/django/bin/django-admin.py b/django/bin/django-admin.py
index c66d195ae5..e08eeccb70 100755
--- a/django/bin/django-admin.py
+++ b/django/bin/django-admin.py
@@ -3,14 +3,6 @@ from django.core import management
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':