So, I was working with an Ant build script to run some Django commands through manage.py
and I started to see an error, but even when running from python;
C:\Users\markw\work\proj\src>python manage.py makemessages --all
--ignore=unittests\* --no-wrap
CommandError: This script should be run from the Django Git tree or your project
or app tree. If you did indeed run it from the Git checkout or your project or
application, maybe you are just missing the conf/locale (in the django tree) or
locale (for project and application) directory? It is not created automatically,
you have to create it by hand if you want to enable i18n for your project or
application.
The only change in my working copy is related to ANT and to confuse me further, the following ANT task completes correctly (as well as just running it from python);
<!-- Compile the translations -->
<target name="compile.trans" depends="init.properties">
<exec executable="${deps.python}"
dir="src"
failonerror="true">
<arg value="manage.py"/>
<arg value="compilemessages"/>
</exec>
</target>
Is there something special about makemessages
? I've tried to run it from src
like compilemessages
which worked just a day ago, and also from mysite
which along with django
has a locale
folder with the .po
files.
Dir structure;
- proj
-- django
-- conf
-- locale
-- mysite
-- locale
manage.py
settings:
LOCALE_PATHS = (
os.path.join(settings_central.BASE_PATH, 'templates', 'locale',),
os.path.join(settings_central.BASE_PATH, 'mysite', 'locale',),
os.path.join(settings_central.BASE_PATH, 'django', 'locale',),
)
Your project layout is slightly incorrect. Your project locale
directory should be proj/locale
and not proj/mysite/locale
, really.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With