Q&A

책을 따라하다가 막히는 부분이 있나요?
질문을 남겨주세요.

176p single_post_page.html 에러

2 years, 7 months ago

ansghltjd ansghltjd

AttributeError at /blog/1/

type object 'Post' has no attribute 'object'
Request Method:GET
Request URL:http://127.0.0.1:8000/blog/1/
Django Version:4.0.3
Exception Type:AttributeError
Exception Value:
type object 'Post' has no attribute 'object'
Exception Location:C:\github\django\blog\views.py, line 18, in single_post_page
Python Executable:C:\github\django\venv\Scripts\python.exe
Python Version:3.10.3
Python Path:
['C:\\github\\django',
 'C:\\Program Files\\Python310\\python310.zip',
 'C:\\Program Files\\Python310\\DLLs',
 'C:\\Program Files\\Python310\\lib',
 'C:\\Program Files\\Python310',
 'C:\\github\\django\\venv',
 'C:\\github\\django\\venv\\lib\\site-packages']
Server time:

Thu, 31 Mar 2022 13:17:05 +0900


pk값에 숫자를넣으면 이런 에러가 뜹니다..


sungyong
sungyong   2 years, 7 months ago

안녕하세요. views.py의 소스코드를 봐야 더 정확하겠지만, object가 아니라 objects 아닐까요?

Updated: March 31, 2022, 1:31 p.m.

Leave a Comment:
목록보기
Search
  • 자유게시판
  • Q&A