Open leesoojeong opened 5 years ago
model이 잘 구현되어있는지를 확인하기 위해서,
from .models import Article, Comment from django.contrib.auth.models import User
로 shell에서 적었는데,
from .models import Article, Comment
에서
KeyError: "'name' not in globals"
라는 에러가 떠서,
from blog.models import Article, Comment로 바꿨더니
문제없이 잘 됩니다.
혹시 from .models import Article, Comment 로도 잘 작동이 되는게 정상인것인가요? 감사합니다!
코드의 위치 문제로 보입니다. 제가 작성했을 때 보다 한 단계 위의 directory에서 작성하신 것 같네요. 적어주신 것 같이 작성해서 작동하면 괜찮습니다.
model이 잘 구현되어있는지를 확인하기 위해서,
from .models import Article, Comment from django.contrib.auth.models import User
로 shell에서 적었는데,
from .models import Article, Comment
에서
KeyError: "'name' not in globals"
라는 에러가 떠서,
from blog.models import Article, Comment로 바꿨더니
문제없이 잘 됩니다.
혹시 from .models import Article, Comment 로도 잘 작동이 되는게 정상인것인가요? 감사합니다!