Skip to content Skip to sidebar Skip to footer

Why Would The Makemessages Function For Django Language Localization Ignore Html Files?

I am trying to run the Django language localization on a project, but makemessages always ignores the html templates in my templates folder. I'm running python manage.py makemessa

Solution 1:

Try creating symlink for your templates folder in your app folder. Then call makemessages from your app folder with symlink switch django-admin.py makemessages --all --symlinks

cd /myproject
ln -s /myproject/templates /myproject/myapp/templates    
cd /myproject/myapp
django-admin.py makemessages --all --symlinks

makemessages ignores TEMPLATE_DIRS and INSTALLED_APPS. Templates dir needs to be inside your app folder and makemessages needs to be called from inside your app folder.

Solution 2:

Your templates folder either needs to be in an app that has been listed in INSTALLED_APPS or in a directory that has been listed in TEMPLATE_DIRS - in your settings.py file

Post a Comment for "Why Would The Makemessages Function For Django Language Localization Ignore Html Files?"