Fixed CommandError: Unable to find a locale path to store translations for file __init__.py

By: summonagus ● at Feb. 27, 2017, 12:04 p.m. ● and modified at Feb. 27, 2017, 12:04 p.m.
Posted under: #Problem, #Settings, #Django, #Solution, #Internationalization, #Multi Languages ● Your ip address: 54.224.184.33 ● views: 123 times.

AD Space Available, Book Now!

Hello guys, this day I want to share a simply tutorial how to fix CommandError: Unable to find a locale path to store translations for file <app_name>/__init__.py for Django 1.10

In my previous LOCALE_PATHS inside file of settings.py is like this:

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'projectname/locale'),
)

This should an error if you work under Django>=1.10.5, because as docs says, LOCALE_PATHS is a list, an not tupe.

LOCALE_PATHS = [
    os.path.join(BASE_DIR, 'projectname/locale'),
]

Hope it usefull..

Author

summonagus

Python Developer, Linux Enthusiast, and Senior writer at python.web.id
Website: https://github.com/agusmakmun
blog comments powered by Disqus