0

I could set and use set_language() as shown below:

# "core/urls.py"

...

urlpatterns += [
    path("i18n/", include("django.conf.urls.i18n")) # Here
]

Now, I want to change the default cookie name django_language below considering the security because users can easily know that Django is used for the website:

enter image description here

So, how can I change the default cookie name django_language?

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129

1 Answers1

0

By setting LANGUAGE_COOKIE_NAME in settings.py as shown below, you can change the default cookie name django_language set by set_language():

# "core/settings.py"

LANGUAGE_COOKIE_NAME = "mylang"

Then, you can change it to mylang as shown below:

enter image description here

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129