Skip to content

Instantly share code, notes, and snippets.

@juanmhidalgo
Last active February 11, 2016 14:39
Show Gist options
  • Save juanmhidalgo/c0280cae50c2ca9c91d7 to your computer and use it in GitHub Desktop.
Save juanmhidalgo/c0280cae50c2ca9c91d7 to your computer and use it in GitHub Desktop.
[django] ClassBasedView with csrf_exempt
from django.views.generic.base import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
class ExampleView(View):
@method_decorator(csrf_exempt)
def dispatch(self, request, *args, **kwargs):
return super(ExampleView, self).dispatch(request, *args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment