Tests: Language chooser middleware warning during tests
Investigate separately these non-failing warnings
......................../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
warnings.warn(
............................................................/usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
warnings.warn(
../usr/local/lib/python3.12/site-packages/admin_interface/templatetags/admin_interface_tags.py:29: UserWarning: Language chooser requires 'django.middleware.locale.LocaleMiddleware' in your MIDDLEWARE to work.
warnings.warn
Originally posted by @JacobCoffee in https://github.com/python/pythondotorg/issues/2741#issuecomment-2970938066
Hi @JacobCoffee , I'd like to request assignment to this issue. I'm building experience in Python/Django through open source contributions and this looks like a great learning opportunity. My understanding: The admin_interface package is throwing warnings because it expects LocaleMiddleware in the MIDDLEWARE settings for its language chooser functionality. The solution would be to either add the required middleware or configure the package to disable the language chooser if internationalization isn't needed. Thanks! Emmanuel. P.S I am working full time so please let me know if there is a deadline to work towards
Hi @JacobCoffee, The warnings were due to missing pieces:
- LocaleMiddleware in the middleware stack
- The set_language URL in the root URLConf I’ve added both locally and the warnings are gone. If nobody else is working on this, would it be alright if I open a PR with the fix?
Hi @JacobCoffee 👋 I noticed that outbound links take more than 5 seconds to navigate to. You might find our free AI Dev Toolkit helpful – it can auto-fix bugs, generate docs, and optimize code in seconds: https://rapidapi.com/mimi800-mimi800-default/api/master-dev-api
@JacobCoffee Hi , Is this issue still open I would like to work on this please let me know!