Hi Uri. > To customize FORMAT_SETTINGS I had to patch 14 files, because the tests failed and I had to patch the tests too.
I managed to get a moment to look at your Speedy Net code. The 14 files here is because you have so many entry points (multiple manage.py and wsgi.py files) — most project just don't have that. Your locale patches was a pretty simple work-around: from django.conf import settings as django_settings from django.utils import formats def patch(): formats.FORMAT_SETTINGS = formats.FORMAT_SETTINGS.union(django_settings.FORMAT_SETTINGS) I'm wondering if any logic we could add would be worth the complication given that this is available...(?) On Monday, 2 December 2019 05:32:53 UTC+1, Uri wrote: > > Django developers, > > I just added this feature request: > https://code.djangoproject.com/ticket/31052 > > I customized FORMAT_SETTINGS in Speedy Net, you can see more information > in this commit: > > https://github.com/speedy-net/speedy-net/commit/f5dc4896c136a816ab9fe0dc360d3fd59d0a5f33 > > > > And on Stack Overflow: > > https://stackoverflow.com/questions/57188435/django-how-do-i-override-default-date-formats-per-locale > > > To customize FORMAT_SETTINGS I had to patch 14 files, because the tests > failed and I had to patch the tests too. Is it possible to let Django users > customize FORMAT_SETTINGS without having to patch files? For example you > can check if the settings contain FORMAT_SETTINGS, and if it is - include > these settings in the global FORMAT_SETTINGS (a union, like in the above > commit). > > formats.FORMAT_SETTINGS = > formats.FORMAT_SETTINGS.union(django_settings.FORMAT_SETTINGS) > > אורי > u...@speedy.net <javascript:> > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/15cef17a-3340-4b0d-b80b-c2cb5ecf1f49%40googlegroups.com.