From what I read FORMAT_MODULE_PATHallows you to use custom formats.
How do I access the first value from DATETIME_INPUT_FORMATSin my application?
The variable DATETIME_INPUT_FORMATSfor german should be '%d.%m.%Y', while for English it should be '%Y-%m-%d'. I want to use the values from formats.py files depending on the language.
I have followed the Django documentation on how to use a variable FORMAT_MODULE_PATH, but I am not getting the expected results.
settings.py:
USE_L10N = True
USE_I18N = True
FORMAT_MODULE_PATH = 'myproject.formats'
myproject/
formats/
__init__.py
en/
__init__.py
formats.py
de/
__init__.py
formats.py
I change the browser language from English to German, and vice versa, and nothing happens with the date format. It is always '%Y-%m-%d'. The date format displayed is the value settings.DATE_INPUT_FORMATS[0].
Django version is 1.2.5, and Python version is 2.5.4.