解决Django 403错误:CSRF verification failed. Request aborted

2023/6/19 9:37:57

Category 软件技术 Tag django,403,csrf

进行微信小程序开发时调用django的后端接口出现403的错误:this can occur when there is a genuine Cross Site Request Forgery


解决办法:

settings.py,在 MIDDLEWARE_CLASSES 中注释掉 'django.middleware.csrf.CsrfViewMiddleware',