강의로 돌아가기
-

오류가 나는듯 합니다

Traceback (most recent call last):
File manage.py, line 22, in
execute_from_command_line(sys.argv)
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py, line 363, in execute_from_command_line
utility.execute()
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py, line 337, in execute
django.setup()
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py, line 108, in populate
app_config.import_models()
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py, line 202, in import_models
self.models_module = import_module(models_module_name)
File C:\Users\jh\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File , line 978, in _gcd_import
File , line 961, in _find_and_load
File , line 950, in _find_and_load_unlocked
File , line 655, in _load_unlocked
File , line 678, in exec_module
File , line 205, in _call_with_frames_removed
File D:\code\mysite\elections\models.py, line 4, in
class Candidate(models.Model):
File D:\code\mysite\elections\models.py, line 5, in Candidate
name - models.CharField(max_length=10)
NameError: name 'name' is not defined
라고 나오네요... 어떻게 할까요?

1 개의 답변
Demi

NameError: name 'name' is not defined

name이 정의되지 않았다는 뜻입니다. 코드에 name을 선언하지 않았거나, 타자를 잘못쳐서 mame같은 글자로 되어 있는지 확인해보세요.
이 이상은 전체 코드를 봐야 정확하게 답변할 수 있습니다.

답변 쓰기
이 입력폼은 마크다운 문법을 지원합니다. 마크다운 가이드 를 참고하세요.