I was struggling to send a post request. I found that i had to install django cors headers then the view worked.