Git command when translating files in Django

[11:08:21] sobolev :: MacBook-Pro-Nikita ➜ Documents/PyCharmProjects/nsp ‹master*› » python manage.py compilemessages --settings nsp.settings 2 ↵ CommandError: This script should be run from the Django Git checkout or your project or app tree, or with the settings module specified.

I have got this error while I truly was inside project root folder. The problem was, that I was running this command without python manage.py makemessages first.

The error message is misleading.


The error holds the answer, you could be running the script from anywhere so it cannot know which files to compile. Run the command from the project directory or specify the settings and you should be fine.


If you are using docker containers to build and deploy your application you should copy folder:

conf/

from root folder of your django project. with the conf folder you should see i.e:

processing file django.po in /gamma/conf/locale/en/LC_MESSAGES
processing file django.po in /gamma/conf/locale/es/LC_MESSAGES
processing file django.po in /gamma/conf/locale/pt_BR/

without the conf folder you should see a clueless message like that:

CommandError: This script should be run from the Django Git checkout or your project or app tree, or with the settings module specified.