Skip to content

Instantly share code, notes, and snippets.

@eugena
Created November 12, 2015 10:46
Show Gist options
  • Save eugena/c5c709c75daaf0ffaa7b to your computer and use it in GitHub Desktop.
Save eugena/c5c709c75daaf0ffaa7b to your computer and use it in GitHub Desktop.
SessionAuthentication without csrf token check
from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication(SessionAuthentication):
"""
SessionAuthentication without csrf token check
"""
def enforce_csrf(self, request):
"""
Not performing csrf token check
"""
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment