class ChromeLoginView(View):
def get(self, request):
return JsonResponse({\'status\': request.user.is_authenticated()})
@method_decorator(csrf_
If you are looking for Mixins to match your needs, then you can create a CSRFExemptMixin and extend that in your view no need of writing above statements in every view:
class CSRFExemptMixin(object):
@method_decorator(csrf_exempt)
def dispatch(self, *args, **kwargs):
return super(CSRFExemptMixin, self).dispatch(*args, **kwargs)
After that Extend this in your view like this.
class ChromeLoginView(CSRFExemptMixin, View):
You can extend that in any view according to your requirement, That's reusability! :-)
Cheers!