django1.5 自定义User模块后执行 syncdb 总是报错 TypeError: create_superuser() takes exactly 4 arguments (3 given)

2014-01-31 23:18:45 +08:00
 daodao
django1.5 自定义User模块后执行 syncdb 总是报错 ```TypeError: create_superuser() takes exactly 4 arguments (3 given)```


http://sfault-image.b0.upaiyun.com/92/6f/926fa441e09e077c397cea5d8fad422d

源码如下:

https://gist.github.com/idao/8734025

Google 上有一些提问,但是好像全部都是集中在 ```REQUIRED_FIELD = [''] ```的问题,然后我逐一检查了下,以我的理解应该是没有问题的了...

http://python.6.x6.nabble.com/Syncdb-error-with-new-1-5rc1-td5001568.html
https://groups.google.com/d/topic/django-users/RnPEUEAvvE0
3858 次点击
所在节点    Python
8 条回复
wtracyliu
2014-01-31 23:38:11 +08:00
PassportManager里面那个create_superuser是不是应该用下super ??
crazycookie
2014-01-31 23:43:07 +08:00
现在 1.6了 请更新
ps:是第一次syncdb? 数据库是空的么?
python manage.py create superuser 貌似这个可以,具体请:
python manage.py help
alexapollo
2014-01-31 23:44:06 +08:00
DJANGO 1.5:def create_superuser(self, username, email, password, **extra_fields):
你的:def create_superuser(self, email, alias, password):

按着上面那种试试?
daodao
2014-01-31 23:54:19 +08:00
@crazycookie 数据库里面没有内容,但是已经创建了zhuo这个数据库
daodao
2014-01-31 23:54:36 +08:00
搞不定啊...一晚上了...
ritksm
2014-01-31 23:55:45 +08:00
哈哈哈。。。LS的同学们能靠谱点么。。。根据源代码。。。于是LZ少了个'S'

daodao
2014-01-31 23:58:24 +08:00
@ritksm ...大侠NB...又是这种低级错误!
RIcter
2014-02-01 09:32:22 +08:00
最近也在写一个django的论坛,各种重写..各种翻django源码....
虽然django方便不少,但是有时候还是局限的要死(●´ω`●)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/98778

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX