python - 为什么我不能使用 'django-admin.py makemessages -l cn'

标签 python django

打印:

D:\zjm_code\register2>python D:\Python25\Lib\site-packages\django\bin\django-adm
in.py makemessages -l cn
Error: This script should be run from the Django SVN tree or your project or app
 tree. If you did indeed run it from the SVN checkout or your project or applica
tion, 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 ha
ve to create it by hand if you want to enable i18n for your project or applicati
on.

2.我做了一个locale目录,然后

D:\zjm_code\register2>python D:\Python25\Lib\site-packages\django\bin\django-adm
in.py makemessages -l cn
processing language cn
Error: errors happened while running xgettext on __init__.py
'xgettext' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

D:\Python25\lib\site-packages\django\core\management\base.py:234: RuntimeWarning
: tp_compare didn't return -1 or -2 for exception
  sys.exit(1)

3。 好的

http://hi.baidu.com/zjm1126/blog/item/f28e09deced15353ccbf1a82.html

最佳答案

  1. register2 是您的项目还是应用树?
  2. 你创建目录 register2\\locale 了吗?

关于python - 为什么我不能使用 'django-admin.py makemessages -l cn',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2144503/

相关文章:

Python pandas从一列字符串的数据选择中过滤掉nan

python - 使用 networkx 查找三角形总数

Python Numpy 随机数 - 不一致?

Python 打包 : Generate a python file at installation time, 与 tox 一起工作

python - django/python - 在我的基础设施和客户之间交换数据的推荐安全方法是什么?

django - Django 如何提供媒体文件?

django - GORM的“有很多”关联没有创建外键?

Django Rest Framework - 注册后返回身份验证 token

Python virtualenv 没有名为 django 的模块

django - 使用 create-react-app 自定义静态文件路径?