“No 'Access-Control-Allow-Origin' header is present on the requested resource” in django

前端 未结 11 686
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 16:44

I am newbie to django and using it as back end for an application that creates users. In front end the code for posting the user name is :

var xobj = new XM         


        
11条回答
  •  独厮守ぢ
    2020-12-02 17:25

    In my case, I had simply forgotten to add a trailing slash at the end of the REST API URL. ie, I had this:

    http://127.0.0.1:8000/rest-auth/login
    

    Instead of this:

    http://127.0.0.1:8000/rest-auth/login/
    

提交回复
热议问题