1. Install the package to solve cross-domain related problems at the terminal
python -m pip install django-cors-headers
2. Add the following configuration to the setting.py file clock in the django project
‘corsheaders’,
comment csrf out and add ‘corsheaders.middleware.CorsMiddleware’,
finally add these two lines of configuration
Read More:
- Spring boot uses configuration interface webmvcconfigurer to solve cross domain problems
- [GO]Solve request origin not allowed by Upgrader.CheckOrigin websocket cross-domain
- How to Solve forEach cannot exit the loop Issue
- How to Solve Nginx cross compilation Error
- How to Solve Hmaster hangs up issue due to namenode switching in Ha mode
- How to Solve Altium designer Rule Check Without an Error Issue
- Error received: error: xhr’get’to URL cross domain [How to Solve]
- How to Solve Vue Error: EACCES: permission denied
- How to Fix KeyError: ‘plotly_domain’
- Vue: How to Solve Error uncaught (in promise) cancel
- How to Solve Error: failed to load response
- [Solved] Error: Django is not importable in this environment
- django Internal server error 500 Modify source code to view print errors
- How to Solve using stm32f4 to drive PS2 error
- Introduce wangeditor5 to run an error: You may need an appropriate loader to handle this file type (es6 compatibility issue)
- How to Fix the common Warning Errors after Vue Project Startup
- Solve the VUE startup problem (You may use special comments to disable some warnings)
- How to Solve Valgrind 3.14 error on ARM 64
- How to Solve Kotlin unresolved reference error
- How to Fix Node SASS Error in Vue + webpack project after nodejs upgrade