unable to create translation files

58 views
Skip to first unread message

gerard

unread,
Dec 10, 2014, 4:59:00 AM12/10/14
to django...@googlegroups.com
hello all,

i'm using Django 1.4 LTS, and try to add localisation to my project.
According the doc:
https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#localization-how-to-create-language-files

i have to do:
django-admin.py makemessages --all

i did it and have the error:
django-admin.py makemessages -v 3 --traceback --all
--settings=agenda.settings
...
ImportError: Could not import settings 'agenda.settings' (Is it on
sys.path?): No module named agenda.settings

but it exists:
$ python manage.py shell
Python 2.7.8 (default, Oct 19 2014, 16:03:53)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.51)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from agenda.settings import *
>>>

Anybody can help? Thanks in advance,

--
Gérard Henry

Tom Evans

unread,
Dec 10, 2014, 10:03:12 AM12/10/14
to django...@googlegroups.com
"python manage.py makemessages --settings=agenda.settings"

I suspect the difference is between running manage.py and running
django-admin.py - manage.py might add the directory containing it to
sys.path.

If you run "python" (rather than manage.py shell) in the directory you
are trying to makemessages in, can you import agenda.settings?

Cheers

Tom

gerard

unread,
Dec 10, 2014, 10:30:31 AM12/10/14
to django...@googlegroups.com
Le 10/12/2014 16:02, Tom Evans a écrit :

> "python manage.py makemessages --settings=agenda.settings"
>
> I suspect the difference is between running manage.py and running
> django-admin.py - manage.py might add the directory containing it to
> sys.path.
>

you're right:
$ python manage.py makemessages --all --settings=agenda.settings -v 3
--traceback --all
examining files with the extensions: .html and .txt

very thanks!


--
Gérard Henry
Reply all
Reply to author
Forward
0 new messages