V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
daodao
V2EX  ›  Python

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

  •  
  •   daodao · 2014-01-31 23:18:45 +08:00 · 3783 次点击
    这是一个创建于 3744 天前的主题,其中的信息可能已经有所发展或是发生改变。
    django1.5 自定义User模块后执行 syncdb 总是报错 ```TypeError: create_superuser() takes exactly 4 arguments (3 given)```


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

    源码如下:



    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
    8 条回复    1970-01-01 08:00:00 +08:00
    wtracyliu
        1
    wtracyliu  
       2014-01-31 23:38:11 +08:00
    PassportManager里面那个create_superuser是不是应该用下super ??
    crazycookie
        2
    crazycookie  
       2014-01-31 23:43:07 +08:00
    现在 1.6了 请更新
    ps:是第一次syncdb? 数据库是空的么?
    python manage.py create superuser 貌似这个可以,具体请:
    python manage.py help
    alexapollo
        3
    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
        4
    daodao  
    OP
       2014-01-31 23:54:19 +08:00
    @crazycookie 数据库里面没有内容,但是已经创建了zhuo这个数据库
    daodao
        5
    daodao  
    OP
       2014-01-31 23:54:36 +08:00
    搞不定啊...一晚上了...
    ritksm
        6
    ritksm  
       2014-01-31 23:55:45 +08:00
    哈哈哈。。。LS的同学们能靠谱点么。。。根据源代码。。。于是LZ少了个'S'

    daodao
        7
    daodao  
    OP
       2014-01-31 23:58:24 +08:00
    @ritksm ...大侠NB...又是这种低级错误!
    RIcter
        8
    RIcter  
       2014-02-01 09:32:22 +08:00
    最近也在写一个django的论坛,各种重写..各种翻django源码....
    虽然django方便不少,但是有时候还是局限的要死(●´ω`●)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1008 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:52 · PVG 07:52 · LAX 16:52 · JFK 19:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.