小编Eri*_*hri的帖子

禁止 (403) CSRF 验证失败。请求被中止。失败原因:来源检查失败与任何可信来源不匹配

帮助

\n

失败原因给出:

\n
Origin checking failed - https://praktikum6.jhoncena.repl.co does not match any trusted origins.\n
Run Code Online (Sandbox Code Playgroud)\n

一般来说,当存在真正的跨站请求伪造时,或者当 Django\xe2\x80\x99s CSRF 机制未正确使用时,就会发生这种情况。对于 POST 表单,您需要确保:

\n
Your browser is accepting cookies.\nThe view function passes a request to the template\xe2\x80\x99s render method.\nIn the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.\nIf you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those …
Run Code Online (Sandbox Code Playgroud)

python django csrf django-csrf python-3.x

80
推荐指数
3
解决办法
9万
查看次数

标签 统计

csrf ×1

django ×1

django-csrf ×1

python ×1

python-3.x ×1