Django

Code

Ticket #2323 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

make-messages.py not working outside of django apps

Reported by: Ahmad Alhashemi Assigned to: adrian
Milestone: Component: Internationalization
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

It seems that the translation module now requires 'settings'. This makes it impossible to run make-messages.py outside of an application. This is waht I got when I ran 'make-messages -u' in django's root directory:

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\django\bin\make-messages.py", line 3, in ?
    from django.utils.translation.trans_real import templatize
  File "C:\Python24\lib\site-packages\django\utils\translation\__init__.py", line 3, in ?
    if settings.USE_I18N:
  File "C:\Python24\lib\site-packages\django\conf\__init__.py", line 28, in __getattr__
    self._import_settings()
  File "C:\Python24\lib\site-packages\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.

I tried changing the import line from this: from django.utils.translation import templatize

To this: from django.utils.translation.trans_real import templatize

But it still has to run init.py.

I took the liberty to assign it to adrian becasue he is the one who broke it :)

Attachments

Change History

07/11/06 03:44:48 changed by Ahmad

Please note that the second line in the traceback show my trial to fix the problem. Everything else is the same as the error you would get from trunk.

07/19/06 07:09:53 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [3374]) Fixed #2323 -- Made it possible to run make-messages without needing a DJANGO_SETTINGS_FILE setting.


Add/Change #2323 (make-messages.py not working outside of django apps)




Change Properties
Action