R
Railway14mo ago
Elf

Django locale not working on production

Hi, I deployed a django app and I use locale settings for 2 languages: english and greek. Although locally works fine, after deployment the greek language urls don't work. Any idea why? in settings.py i have this config: LANGUAGE_CODE = 'en' TIME_ZONE = 'UTC' USE_I18N = True USE_TZ = True EXTRA_LANG_INFO = { 'gr': { 'bidi': False, 'code': 'gr', 'name': 'greek', 'name_local': 'Ελληνικά', }, 'en': { 'bidi': False, 'code': 'en', 'name': 'English', 'name_local': 'English', }, } LANG_INFO = dict(EXTRA_LANG_INFO.items()) django.conf.locale.LANG_INFO = LANGINFO LANGUAGES = ( ('en', ('English')), ('gr', _('Greek')), ) LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale/'), ) Project id: afb57b50-917e-49d3-a975-e7f460f74eb6
Solution:
is gr even the correct language code for greek?
No description
Jump to solution
8 Replies
Percy
Percy14mo ago
Project ID: afb57b50-917e-49d3-a975-e7f460f74eb6
Brody
Brody14mo ago
do you have the tzdata package in your requirements.txt?
Elf
ElfOP14mo ago
Yes, tzdata==2023.3
Solution
Brody
Brody14mo ago
is gr even the correct language code for greek?
No description
Brody
Brody14mo ago
looks like iso 639-1 is used, and that means the language code is el
Elf
ElfOP14mo ago
Ok, I thought it was gr because it worked locally. I'll change it to el. Thanks for suggestion, I didn't notice it
Elf
ElfOP14mo ago
Yes, that worked! Thank you for your help
Brody
Brody14mo ago
no problem! guess your local computer's locale database has gr for greek too
Want results from more Discord servers?
Add your server