Making corsheaders in django work with react!

Job ID: 34073944

Budget: $10 – $30 USD

Hi! I've built an application in django/react but now I need the corsheaders to work

1. Get Request from react with axios.defaults.withCredentials = true
2. It returns...

"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:8000/uploads/preview-sales-posts?q=&page=1&lat=55.45338959999999&long=13.0232347&dist=9999999. (Reason: CORS request did not succeed). Status code: (null)."


Why I need it to work is because AllAuth in Django needs it when changing password.



To complete this task
1. Have it so that when i include axios.defaults.withCredentials = true in react it should be able to make requests to the django backend without cors warnings

2. 127.0.0.1:8000/accounts/password/change/ should be able to be called from the react application to the backend without giving unauthorized or no permission etc. It seems it needs the csrftoken to find the correct account. So if 1st is solved this most likely also gets solved.

If interested further information can be given over chat etc
Related categories: Django React.js