pip install django-cors-headers 添加应用 在settings里面配置 INSTALLED_APPS = ( ...'corsheaders', ... ) 中间层设置 MIDDLEWARE = ['corsheaders.middleware.CorsMiddleware', ... ] 添加白名单 # CORSCORS_ORIGIN_WHITELIST = ('127.0.0.1:8080','localhost:8080',#凡是出现在白名单中的域名,都可以访...
This is a continuation of the discussion at #57 Consider a modern stack where there is a frontend application that is completely decoupled from the API server. The cookies are still saved in the browser on the API server, and they are se...
修改~/.virtualenvs/building-api-django/lib/python3.6/site-packages/django/db/backends/mysql/base.py use_precompiled_packages可以阻止zappa使用默认的package,但这里暂不需要这个。 二、设置CORS 只能Json格式 Ref:https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/ManageCorsUsing.html [ {"Allo...