Last active
December 16, 2020 07:20
-
-
Save Soyuzbek/f56dc30ab03433405e74cae726acb8b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.shortcuts import redirect | |
def language_view(request, lang): | |
response = redirect(request.META.get('HTTP_REFERER', '/')) | |
response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang) | |
return response | |
# © 2020 GitHub, Inc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment