How to solve the cross-domain problem of Django?
please see this article, very detailed: https://pypi.org/project/django-cors-headers/
The above is due to the CSRF problem, how to solve?
Two ways:
Top: comment out CsrfViewMiddleware
as shown, but
is not recommended
Second: add the annotation @csrf_exempt
to the interface view
The above two methods do solve 403 errors.
However, according to a lot of information, the approach is that the front end first USES get request to specify the interface, and then the server generates get_token(request)
to return to the front end. The front end carries csrftoken
returned when requesting the interface, which will verify whether the cookie is consistent…
But they all tried in vain…
We can see the article: https://www.cnblogs.com/rgcLOVEyaya/p/RGC_LOVE_YAYA_692days_802_1.html
Read More:
- CSRF verification failed. Request aborted.
- egg.js The frame post request reported an error of invalid CSRF token security verification, which has been solved
- Nextcloud error: “access forbidden CSRF check failed”
- 8、Forbidden (CSRF token missing or incorrect.): /register/
- [nodejs] error request aborted after request routing in post mode
- Flash + Vue uses Axios to obtain server data, and reports error: “request aborted”
- Four ways to get Django parameters in request
- Error 1: Vue quickly clicks the route to jump. Error: uncaught (in promise) error: request aborted
- How to solve the problem of error reporting in the introduction of Python Django no module name ‘Django. Utils. Six’
- django.db.utils.OperationalError: no such table: django_admin_log
- django.core.exceptions . improveconfigured: error loading MySQL DB module. Django configuring MySQL database
- UFIDA’s common package download failed with error forbidden
- Flask Request an extension before_request after_request errorhandler
- Failed to load resource: the server responded with a status of 403 (Forbidden)
- Hash verification failed for CDH5.8.2 installation
- Bug:Install Microsoft Visual C++ 2008 Redistributable (x86) Failed Installation aborted, Result=1603
- In the HTML page request Ajax times 400 error, solve Yii submit post form 400 error, and Ajax post request 400 problem (example code)
- Solve host key verification failed [valid]
- Error reported when Windows builds docker image: failed to create LLB definition: 403 Forbidden
- 【Oracle】IMP-00010: not a valid export file, header failed verification