搜尋

首頁  >  問答  >  主體

python - 使用flask-migrate迁移数据库出错!error: too many arguments

这是源码:
 
   # coding=utf-8
from flask_script import Manager
from app import create_app, db
from flask_migrate import Migrate, MigrateCommand

app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)
manager.add_command('db', MigrateCommand)


@manager.command
def dev():
    from livereload import Server
    live_server = Server(app.wsgi_app)
    live_server.watch('**/*.*')
    live_server.serve(open_url=True)

@manager.command
def test():
    pass

@manager.command
def deploy():
    pass


if __name__ == '__main__':
    manager.run() 



运行时就报错了:(求解答)


(virtualenv) E:\Dome\Django\item\test_1>python manager.py db migrate -m 'initial migration'
usage: manager.py [-?] {shell,deploy,db,dev,runserver,test} ...
manager.py: error: too many arguments
PHPzPHPz2812 天前974

全部回覆(1)我來回復

  • 怪我咯

    怪我咯2017-04-18 09:51:10

    你試試看

    python manager.py db migrate --message "initial migration"

    參數太多這種error很讓人無奈。你也可以直接把後面的-m '...'刪除掉看看能否運行。

    回覆
    0
  • 取消回覆