Skip to content

Instantly share code, notes, and snippets.

@sleepless-se

sleepless-se/django_set_cookies.py Secret

Last active Jan 5, 2021
Embed
What would you like to do?
class MyView(TemplateView):
def render_to_response(self, context, **response_kwargs):
response = super().render_to_response(context, **response_kwargs)
response.set_cookie("key","value")
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment