跨域

    -- 浏览器的同源策略 阻止ajax请求 不阻止src请求
-- jsonp
-- 我们利用src发送请求
-- core
-- class MyCore(MiddlewareMixin):
def process_response(self, request, response):
response['Access-Control-Allow-Origin'] = "*"
if request.method == "OPTIONS":
# 复杂请求 预检
response['Access-Control-Allow-Headers'] = "Content-Type"
response['Access-Control-Allow-Methods'] = "POST, DELETE, PUT"
return response
05-11 22:58