python生成数据库指令_django使用python manage.py makemigrations命令不能生成数据库表...

G:\pythondemo\myblog>python manage.py makemigrations

Traceback (most recent call last):

File "manage.py", line 22, in

execute_from_command_line(sys.argv)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\managem

ent\__init__.py", line 367, in execute_from_command_line

utility.execute()

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\managem

ent\__init__.py", line 341, in execute

django.setup()

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\__init__.py"

, line 27, in setup

apps.populate(settings.INSTALLED_APPS)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registr

y.py", line 108, in populate

app_config.import_models(all_models)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\config.

py", line 199, in import_models

self.models_module = import_module(models_module_name)

File "C:\Program Files (x86)\Python36-32\lib\importlib\__init__.py", line 126,

in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 994, in _gcd_import

File "", line 971, in _find_and_load

File "", line 955, in _find_and_load_unlocked

File "", line 665, in _load_unlocked

File "", line 678, in exec_module

File "", line 219, in _call_with_frames_removed

File "G:\pythondemo\myblog\blog\models.py", line 7, in

class Article(models.Model):

File "G:\pythondemo\myblog\blog\models.py", line 8, in Article

title = models.CharField(max_lenth=32,default='True')

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\db\models\fi

elds\__init__.py", line 1043, in __init__

super(CharField, self).__init__(*args, **kwargs)

TypeError: __init__() got an unexpected keyword argument 'max_lenth'

G:\pythondemo\myblog>

G:\pythondemo\myblog>

G:\pythondemo\myblog>dir

驱动器 G 中的卷是 新加卷

卷的序列号是 CC4F-88E9

G:\pythondemo\myblog 的目录

2018/04/11  21:20    

2018/04/11  21:20    

2018/04/11  21:24    

2018/04/11  21:11    

2018/04/11  14:56            12,288 db.sqlite3

2018/04/11  21:20               804 manage.py

2018/04/11  17:01    

2 个文件         13,092 字节

5 个目录 34,452,447,232 可用字节

G:\pythondemo\myblog>

G:\pythondemo\myblog>

G:\pythondemo\myblog>

G:\pythondemo\myblog>python manage.py makemigrations

Traceback (most recent call last):

File "manage.py", line 22, in

execute_from_command_line(sys.argv)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\managem

ent\__init__.py", line 367, in execute_from_command_line

utility.execute()

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\core\managem

ent\__init__.py", line 341, in execute

django.setup()

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\__init__.py"

, line 27, in setup

apps.populate(settings.INSTALLED_APPS)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\registr

y.py", line 108, in populate

app_config.import_models(all_models)

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\apps\config.

py", line 199, in import_models

self.models_module = import_module(models_module_name)

File "C:\Program Files (x86)\Python36-32\lib\importlib\__init__.py", line 126,

in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 994, in _gcd_import

File "", line 971, in _find_and_load

File "", line 955, in _find_and_load_unlocked

File "", line 665, in _load_unlocked

File "", line 678, in exec_module

File "", line 219, in _call_with_frames_removed

File "G:\pythondemo\myblog\blog\models.py", line 7, in

class Article(models.Model):

File "G:\pythondemo\myblog\blog\models.py", line 8, in Article

title = models.CharField(max_lenth=32,default='True')

File "C:\Program Files (x86)\Python36-32\lib\site-packages\django\db\models\fi

elds\__init__.py", line 1043, in __init__

super(CharField, self).__init__(*args, **kwargs)

TypeError: __init__() got an unexpected keyword argument 'max_lenth'

G:\pythondemo\myblog>

G:\pythondemo\myblog>

G:\pythondemo\myblog>

G:\pythondemo\myblog>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值