React JS cant post data to django
I am writing this app that implements the crud operations. Whenever I fetch, I get the data successful from backend however when I try to update or add an object. I get 405 error through the console. The code is clean.
If your react app and django app works on different ports, you have to setup a CORS system first:
https://pypi.org/project/django-cors-headers/
If your react app compiles in to a single file and you run it via script tag in your html, then there is a problem in your django view. Make sure you handle post requests in related view. If you provide your code to us we can help you better.