【问题标题】:How to enabled cors in django1.1 with angular 7?如何使用 Angular 7 在 django1.1 中启用 cors?
【发布时间】:2019-11-19 23:33:15
【问题描述】:

我正在尝试以 Angular 7 开发我的前端,并希望向我的服务器发出 cors 请求以获取数据。

Chrome 和 Firefox 阻止预检请求。

谁能告诉我如何解决这个问题?

在我的 Django 设置中,我已经完成了“CORS_ORIGIN_ALLOW_ALL=True”,但错误仍然存​​在。

使用插件没有帮助。关于 cors 总是有错误。

【问题讨论】:

    标签: cors angular7 django-1.11 django-cors-headers


    【解决方案1】:

    请查看此存储库:

    sandbox-angular

    sandbox-django

    【讨论】:

    • 我确实使用了 django-cors-headers,仍然没有效果。
    猜你喜欢
    • 1970-01-01
    • 2015-08-20
    • 2015-05-29
    • 2020-09-13
    • 2016-02-16
    • 2019-11-18
    • 2015-04-29
    • 2014-07-29
    • 1970-01-01
    相关资源
    最近更新 更多