django-admin-interface: Reverse for 'set_language' not found

I just installed this package on a new project im working on, howerver im getting the following error:

NoReverseMatch at /admin/ Reverse for 'set_language' not found. 'set_language' is not a valid view function or pattern name.

Full Debug Info

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

project’s urls.py :

urlpatterns = [
    path("i18n/", include("django.conf.urls.i18n")),
]
urlpatterns += i18n_patterns(path("admin/", admin.site.urls))

project’s settings.py :

JAZZMIN_SETTINGS = {
    "language_chooser": True,
}

@jforlenza-bnydc the language-chooser to work correctly needs:

  • settings.USE_I18N = True
  • 2 or more languages listed in settings.LANGUAGES
  • i18n urls and i18n admin urls:
from django.conf.urls.i18n import i18n_patterns

urlpatterns += [url(r'^i18n/', include('django.conf.urls.i18n')),]`
urlpatterns += i18n_patterns(url(r'^admin/', admin.site.urls))

Thank you, that fixed the issue, I was using a boilerplate for experimenting and noticed it had some international options enabled

add this path(“i18n/”, include(“django.conf.urls.i18n”)), central urls.py