﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2309	After introducing USE_I18N runserver throws exception	Djordjevic Nebojsa <nesh at studioquattro co yu>	hugo	"When I start my dev server I got following exception:
{{{
$ PYTHONPATH=/Users/nesh/devel/workspace/riznica-mr/riznica:/store/django:/store/contrib/:/usr/local/lib/python2.4/site-packages/:/usr/bin/env python2.4 /Users/nesh/devel/workspace/riznica-mr/riznica/manage.py --settings=riznica.settings runserver
    
Traceback (most recent call last):
  File ""/Users/nesh/devel/workspace/riznica-mr/riznica/manage.py"", line 4, in ?
    import settings # Assumed to be in the same directory.
  File ""/Users/nesh/devel/workspace/riznica-mr/riznica/settings.py"", line 6, in ?
    from django.utils.translation import gettext_lazy as _
  File ""/store/django/django/utils/translation/__init__.py"", line 3, in ?
    if settings.USE_I18N:
  File ""/store/django/django/conf/__init__.py"", line 28, in __getattr__
    self._import_settings()
  File ""/store/django/django/conf/__init__.py"", line 53, in _import_settings
    raise EnvironmentError, ""Environment variable %s is undefined."" % ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.
}}}

or with

{{{
$ PYTHONPATH=/Users/nesh/devel/workspace/riznica-mr/riznica:/store/django:/store/contrib/:/usr/local/lib/python2.4/site-packages/ DJANGO_SETTINGS_MODULE=riznica.settings /usr/bin/env python2.4 /Users/nesh/devel/workspace/riznica-mr/riznica/manage.py --settings=riznica.settings runserver
      
Traceback (most recent call last):
  File ""/Users/nesh/devel/workspace/riznica-mr/riznica/manage.py"", line 4, in ?
    import settings # Assumed to be in the same directory.
  File ""/Users/nesh/devel/workspace/riznica-mr/riznica/settings.py"", line 6, in ?
    from django.utils.translation import gettext_lazy as _
  File ""/store/django/django/utils/translation/__init__.py"", line 3, in ?
    if settings.USE_I18N:
  File ""/store/django/django/conf/__init__.py"", line 28, in __getattr__
    self._import_settings()
  File ""/store/django/django/conf/__init__.py"", line 55, in _import_settings
    self._target = Settings(settings_module)
  File ""/store/django/django/conf/__init__.py"", line 83, in __init__
    raise EnvironmentError, ""Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s"" % (self.SETTINGS_MODULE, e)
EnvironmentError: Could not import settings 'riznica.settings' (Is it on sys.path? Does it have syntax errors?): cannot import name gettext_lazy
}}}

Relevant part of setup.py:
{{{
#!python
from django.utils.translation import gettext_lazy as _
USE_I18N = True

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'sr'
LANGUAGES = (
    ('sr', _('Serbian')), 
    ('en', _('English')), 
    ('de', _('German')), 
    ('el', _('Greek')), 
    ('it', _('Italian')), 
)
}}}"	defect	closed	Internationalization	dev	major	fixed		nesh@…	Unreviewed	0	0	0	0	0	0
