【发布时间】:2018-09-13 03:09:51
【问题描述】:
我发现自己处于一个非常奇怪的境地:
- 我没有将我的
.mo文件提交到我的存储库中。我计划在部署后生成它们 - 我在
https://github.com/piotras/heroku-buildpack-gettext.git安装了可用的gettext buildpack
所以这是我做的步骤:
- 部署到heroku。
- 运行
heroku run python manage,py compilemessages -
正在输出:
处理 /app/.heroku/python/lib/python3.6/site-packages/django/contrib/redirects/locale/ru/LC_MESSAGES 中的文件 django.po
处理 /app/.heroku/python/lib/python3.6/site-packages/django/contrib/redirects/locale/cy/LC_MESSAGES 中的文件 django.po
处理 /app/prometheus/locale/zh_hans/LC_MESSAGES 中的文件 django.po
处理 /app/.heroku/python/lib/python3.6/site-packages/django/contrib/gis/locale/sk/LC_MESSAGES 中的文件 django.po
列出文件之一:
heroku run ls /app/.heroku/python/lib/python3.6/site-packages/django/contrib/redirects/locale/zh_Hans/LC_MESSAGES结果:django.mo django.po列出我们的文件:
heroku run ls /app/prometheus/locale/zh_hans/LC_MESSAGES/结果:django.po
django.mo 丢失。
我跑了python manage.py shell 看看我是否有一些变量错误:
heroku run python manage.py shell
In [1]: from django from django.conf import settings
In [3]: print(settings.BASE_DIR)
/app/prometheus
In [4]: print(settings.LOCALE_PATHS)
('/app/prometheus/locale',)
所以我不知道为什么我的 django.mo 文件没有生成。
有什么猜测吗?
【问题讨论】: