2👍
✅
As @Daniel Roseman indicated, @csrf_exempt
will not help you with that.
The middleware responsible for the session cookie is SessionMiddleware
. You can read more about it in the Django Docs: How to use sessions. Unfortunately, there is no similar decorator in order to exempt some specific view.
So in order to customize the middleware’s behaviour, you would need to inherit from SessionMiddleware
. There is a nice answer on the matter on SO.
0👍
csrf_exempt
controls whether or not CSRF is enforced on POST. It has nothing to do with whether or not the CSRF cookie is set; that is done by the CsrfViewMiddleware for all responses.
- [Answered ]-Django-registration module dont send email
- [Answered ]-TemplateDoesNotExist when using as_view()
- [Answered ]-How do test in Django
Source:stackexchange.com