강의로 돌아가기
신 새벽

오류가 나오네요 도와주세요

D:\Work\PG Works\mysite>python manage.py makemigrations
Traceback (most recent call last):
File manage.py, line 22, in
executefromcommandline(sys.argv)
File "C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django\core\management_
init.py, line 367, in execute_from_command_line
utility.execute()
File
C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django\core\management__init
.py, line 341, in execute
django.setup()
File
C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django_init.py", line 27, in setup
apps.populate(settings.INSTALLED
APPS)
File C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django\apps\registry.py
, line 108, in populate
appconfig.importmodels(allmodels)
File C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django\apps\config.py
, line 199, in import
models
self.modelsmodule = importmodule(modelsmodulename)
File C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\importlib\__in
it__.py
, line 126, in importmodule
return _bootstrap.
gcdimport(name[level:], package, level)
File "<frozen importlib.
bootstrap>, 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:\Work\PG Works\mysite\elections\models.py, line 4, in
class Candidate(models.Model):
File
D:\Work\PG Works\mysite\elections\models.py, line 5, in Candidate
name = models.CharField(max_lenth=10)
File
C:\Users\SB\AppData\Local\Programs\Python\Python36-32\lib\site-packages\
django\db\models\fields_init.py", line 1043, in _init__
super(CharField, self).init(args, *kwargs)
TypeError: init() got an unexpected keyword argument 'max_lenth'

1 개의 답변
닉과르

\elections\models.py 파일에서 오타가 난듯 하네요..

name = models.CharField(max_lenth=10)

maxlenth ===> maxlength 로 바꾸고 해보세요.

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