w
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

authentication.py
text/x-python

Download raw (343 bytes)

from rest_framework.authentication import SessionAuthentication, BasicAuthentication 

# cf <https://stackoverflow.com/questions/30871033/django-rest-framework-remove-csrf>
class CsrfExemptSessionAuthentication(SessionAuthentication):

    def enforce_csrf(self, request):
        return  # To not perform the csrf check previously happening