django-cors-headers not work

后端 未结 13 1418
情深已故
情深已故 2020-12-29 04:10

django-cors-headers not work

INSTALLED_APPS = (
    \'django.contrib.admin\',
    \'django.contrib.auth\',
    \'django.contrib.contenttypes\',
    \'django.         


        
13条回答
  •  不思量自难忘°
    2020-12-29 04:23

    Final solution would be send response with CORS allowed headers.

    response["Access-Control-Allow-Origin"] = "*"
    response['Content-Type'] = "application/json; charset=utf-8"
    response["Access-Control-Allow-Origin"] = "*"
    response["Access-Control-Allow-Methods"] = "GET, OPTIONS"
    response["Access-Control-Max-Age"] = "1000"
    response["Access-Control-Allow-Headers"] = "X-Requested-With, Content-Type, My-Token"
    

提交回复
热议问题