I’m using django code for the app server, which is available at https://github.com/AgoraIO/Agora-Chat-API-Examples/tree/main/chat-app-server-django, and this for the web SDK, which is available at https://github.com/AgoraIO-Usecase/AgoraChat-web. i am getting the CORS error. Do I need to enable any Agora settings. A call can also be put up, right?
Getting this error :
The CORS policy has prohibited access to XMLHttpRequest at ‘https://localhost:8000/app/user/register’ from origin ‘http://localhost:3000’: Preflight response fails access control verification: The requested resource doesn’t have a ‘Access-Control-Allow-Origin’ header.
Access-Control-Allow-Origin: *
2
Answers
Try installing this package in the console
Add it to installed apps
Add it to middleware
Now add a list of origins to settings.py
Also set CORS_ORIGIN_ALLOW_ALL to false.
Hope this helps.
If your intent is local development, you have to disable CORS checking in your browser.
See the posts below