[Answered ]-Not able to make a GET request to the django REST API backend for the id=1 article, from axios in reactjs

1πŸ‘

βœ…

I figured out the problem eventually. The problem is the browser cache. I updated django, djago-rest-framework, react and react-router-dom. Then I did a hard reload of the localhost:3000 website and it eventually started working. The key point is to clear the browser cache just after you add corsheaders and it will work. I took help from this Question

πŸ‘€Animesh Kumar

0πŸ‘

It’s because of the CORS policy. Even if you allow the sites in the settings, you need to explicitly enable those websites to access content from your backend. Install cors headers app in Django and set the allowed origins. The documentation for cors headers has sufficient information.

πŸ‘€Abhinav Dev

Leave a comment