django rest framework csrf failed csrf token missing or incorrect

django rest framework csrf failed csrf token missing or incorrect

REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication',)
}

or

MIDDLEWARE_CLASSES = (
'store.disable.DisableCSRF',
)

disable.py

class DisableCSRF(object):

def process_request(self, request):
        setattr(request, '_dont_enforce_csrf_checks', True)

上一篇:mycat垂直分库


下一篇:Java学习--内置对象(其他的)