Django: Ticket #2323: make-messages.py not working outside of django appshttps://code.djangoproject.com/ticket/2323
<p>
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:
</p>
<pre class="wiki">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.
</pre><p>
I tried changing the import line from this:
from django.utils.translation import templatize
</p>
<p>
To this:
from django.utils.translation.trans_real import templatize
</p>
<p>
But it still has to run <span class="underline">init</span>.py.
</p>
<p>
I took the liberty to assign it to adrian becasue he is the one who broke it :)
</p>
en-usDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/ticket/2323
Trac 1.2AhmadTue, 11 Jul 2006 08:44:48 GMThttps://code.djangoproject.com/ticket/2323#comment:1
https://code.djangoproject.com/ticket/2323#comment:1
<p>
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.
</p>
TicketMalcolm TredinnickWed, 19 Jul 2006 12:09:53 GMTstatus changed; resolution sethttps://code.djangoproject.com/ticket/2323#comment:2
https://code.djangoproject.com/ticket/2323#comment:2
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
(In <a class="changeset" href="https://code.djangoproject.com/changeset/3374/">[3374]</a>) Fixed <a class="closed ticket" href="https://code.djangoproject.com/ticket/2323" title="#2323: defect: make-messages.py not working outside of django apps (closed: fixed)">#2323</a> -- Made it possible to run make-messages without needing a
DJANGO_SETTINGS_FILE setting.
</p>
Ticket