cari

Rumah  >  Soal Jawab  >  teks badan

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
PHPzPHPz2807 hari yang lalu955

membalas semua(1)saya akan balas

  • 怪我咯

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

    Anda cuba

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

    Ralat terlalu banyak parameter ini sangat mengecewakan. Anda juga boleh memadamkan terus -m '...' berikut dan lihat sama ada ia berfungsi.

    balas
    0
  • Batalbalas