mar*_*er_ 7 python git ant django
所以,我正在使用Ant构建脚本来运行一些Django命令manage.py,我开始看到一个错误,但即使从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.
Run Code Online (Sandbox Code Playgroud)
我的工作副本中唯一的变化与ANT有关并且让我更加困惑,以下ANT任务正确完成(以及只是从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>
Run Code Online (Sandbox Code Playgroud)
有什么特别的makemessages吗?我试着运行它src像compilemessages刚刚在一天前的工作,并且还从mysite其中沿django有一个locale与文件夹.po的文件.
Dir结构;
- proj
-- django
-- conf
-- locale
-- mysite
-- locale
manage.py
Run Code Online (Sandbox Code Playgroud)
设置:
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',),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2914 次 |
| 最近记录: |