【发布时间】:2015-12-04 03:43:01
【问题描述】:
这是我提出的最后一个问题,但它仍然是错误的方式。 it is here 。所以
回溯在这里:
>>>from app1.models import UserReg
>>> UserReg.objects.create_user(username=u'hello world')
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 187,
in create_user
**extra_fields)
File "C:\Python27\lib\site-packages\django\contrib\auth\models.py", line 180,
in _create_user
date_joined=now, **extra_fields)
TypeError: __init__() got an unexpected keyword argument 'username'
我在 django 包中看到了 models.py,但似乎我没有错。所以如果你能指出我在 django 的 AbstracteUser 模型中的错误之处,我会很高兴。
如果你有什么需要我补充的,我会的。请 :((.
【问题讨论】:
标签: python django django-models