Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django error on makemessages "should be run from the Django Git tree or your project or app tree"

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',),
)
like image 736
markwalker_ Avatar asked Feb 19 '14 14:02

markwalker_


1 Answers

Your project layout is slightly incorrect. Your project locale directory should be proj/locale and not proj/mysite/locale, really.

like image 164
Michael Samoylov Avatar answered Oct 05 '22 15:10

Michael Samoylov