属性错误问题
AttributeError: type object 'Article' has no attribute 'object'
AttributeError at /blog/article/1
type object 'Article' has no attribute 'object'
Request Method:
GET
Request URL:
http://127.0.0.1:8000/blog/article/1
Django Version:
1.11
Exception Type:
AttributeError
Exception Value:
type object 'Article' has no attribute 'object'
Exception Location:
D:\myweb\myblog\blog\views.py in article_page, line 10
Python Executable:
C:\ProgramData\Anaconda3\python.exe
Python Version:
3.6.0
很奇怪,我反复检查了代码也没看出问题啦啊。我的疑惑就是article_id,到底在哪里?之前正则表达式错了,我就用点代替了,出现的错误就是缺少参数article_id,后来我发现要用大写的p之后,正则表达式应该对了,结果告诉我,没有object属性,老师这是什么问题啊。