[问题] django - csrf验证失败

楼主: wahahahaaa (hah)   2020-03-28 15:23:50
最近参考此篇文章: https://ithelp.ithome.com.tw/articles/10202804 学django
出现以下错误: https://imgur.com/071onyE
*Your browser is accepting cookies. -> 已检查 ok
*The view function passes a request to the template's render method.
*In the template, there is a {% csrf_token %} ... 参考文中作者所说 ok
*If you are not using CsrfViewMiddleware... 已检查 ok
*The form has a valid CSRF token. After logging in....
作者: clang (llvm)   2020-03-28 16:29:00
HTML第8行那个不必要,它需要的token要放在form内,吃的是14行那个不过我不觉得这是错误的原因
作者: trew98741   2020-03-28 20:53:00
把 card移到extend后试试摆在你的 block content后一行对 csrf.
作者: yuenu   2020-03-30 00:17:00
那你的base.html是写了什么...
楼主: wahahahaaa (hah)   2020-03-30 15:20:00
在检查了两次重打就好了 可能是档案没储存到@@..

Links booklink

Contact Us: admin [ a t ] ucptt.com