What is the easiest way to solve the CORS policy "No Access-Control-Allow-Origin" header present | Sololearn: Learn to code for FREE!

0

What is the easiest way to solve the CORS policy "No Access-Control-Allow-Origin" header present

I am using react framework and connecting to django for making API requests, but due to the development servers of the two frameworks, running on different 'domains' the browser will not allow the request unless there is an access control allow origin header. I don't know if I have done it correctly but I only thought that declaring the environment variables in react would do the trick. I am not sure on how to enable the access-control-allow-origin header on my requests. Is there something I need to do on the side of django or not?

9/15/2020 6:09:01 AM

prime omondi

1 Answer

New Answer

+2

Use CORS Anywhere: https://github.com/Rob--W/cors-anywhere/