Browse files

Fixed #8702 -- Set up the initial locale correctly for the developmen…

…t server.

Previously, "--noreload" wasn't picking up the default language setting. Thanks
to arien and Karen Tracey for debugging this.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 15644cb commit 1729d92f71694caad39d9ed3a31e1e287104e16f @malcolmt malcolmt committed Aug 30, 2008
Showing with 8 additions and 0 deletions.
  1. +8 −0 django/core/management/commands/
@@ -43,11 +43,18 @@ def handle(self, addrport='', *args, **options):
def inner_run():
from django.conf import settings
+ from django.utils import translation
print "Validating models..."
print "\nDjango version %s, using settings %r" % (django.get_version(), settings.SETTINGS_MODULE)
print "Development server is running at http://%s:%s/" % (addr, port)
print "Quit the server with %s." % quit_command
+ # forces the locale to en-us. We should
+ # set it up correctly for the first request (particularly important
+ # in the "--noreload" case).
+ translation.activate(settings.LANGUAGE_CODE)
path = admin_media_path or django.__path__[0] + '/contrib/admin/media'
handler = AdminMediaHandler(WSGIHandler(), path)
@@ -70,6 +77,7 @@ def inner_run():
if shutdown_message:
print shutdown_message
if use_reloader:
from django.utils import autoreload

0 comments on commit 1729d92

Please sign in to comment.