Have Your tried requesting this endpoint in postman? If the issue persists in postman then the problem is in your backend code and endpoints. If postman process request successfully then your frontend is not picking that url. For that purpose you have to expose/forward your django port with ngrok
ngrok http 8000
Then give that ngrok public url in frontend
For example if ngrok gave you url: https://dehde-343-hdcnd-324n/ -> 8000 then in frontend replace "http://127.0.0.1:8000" with "https://dehde-343-hdcnd-324n/"
It will solve your problem but if the issue still persists then try following:
For testing purpose, give your whole backend signup url to baseUrl of API like this:
const API = axios.create({
baseURL: "http://127.0.0.1:8000/api/register/",
headers: {
"Content-Type": "application/json",
}
});
Also try to remove the last "/" from endpoint and test
http://127.0.0.1:8000/api/register