How to explicitly set django_language in Django session?
Thanks a lot...
Consider using django.views.i18n.set_language(). Activate this view by adding the following line to your URLconf:
# This example makes the view available at /i18n/setlang/
url(r'^i18n/', include('django.conf.urls.i18n')),
As a convenience, Django comes with a view,
django.views.i18n.set_language(), that sets a user’s language preference and redirects to a given URL or, by default, back to the previous page.The view expects to be called via the POST method, with a language parameter set in request. If session support is enabled, the view saves the language choice in the user’s session. Otherwise, it saves the language choice in a cookie that is by default named
django_language. (The name can be changed through theLANGUAGE_COOKIE_NAMEsetting.)