django使用forms表单报错报错 '*Form' object has no attribute 'cleaned_data

'*Form' object has no attribute 'cleaned_data'

django进行forms开发时报错
'LoginForm' object has no attribute 'cleaned_data'

但是实际上这个方法是存在的,后来发现.is_valid()方法的括号给遗漏掉了,后来加上就好了
if form.is_valid():
cd = form.cleaned_data

参考:https://www.iteye.com/blog/msq-1714831

posted @ 2020-02-14 16:12  木,曰曲直  阅读(2075)  评论(0编辑  收藏  举报