python manage.py compilemessages
Creates compiled translation files named like locale/en/LC_MESSAGES/django.mo
from translation source files names like locale/en/LC_MESSAGES/django.po
.
I would like to have the *.mo
files ignored by git and not committed to the repository, as these are not source files.
Heroku already knows to perform
python manage.py collectstatic
for django projects.
How do I make it also perform compile messages
?
Currently I work around the problem by adding the compilation result files (*.mo
) to my repository but I'd like to know if there's a better way.
(If relevant - the repo for my site: https://github.com/yairchu/vote_tool)
You should store them externally on a service like S3 - while Heroku can serve static files, it's not designed to.
Project description This is a Django library for Heroku applications that ensures a seamless deployment and development experience.
bin/post_compile
./manage.py compilemessages
git push origin
git push heroku
As you push your branch to Heroku, it should now run that command. I'm not certain whether having a custom bin/post_compile
file will override the autodetection that Heroku does, so if you find that it's no longer running collectstatic
, just pop that line in under your compilemessages
line, but add --noinput
to the line so that the management command doesn't prompt you to type "Yes" to confirm you want to overwrite existing files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With