0

我尝试在 heroku 上上传烧瓶应用程序但我无法尝试命令“heroku run init”和“heroku run python manage.py db create”但得到错误

Traceback (most recent call last):
  File "manage.py", line 3, in <module>
    from flask.ext.migrate import Migrate, MigrateCommand
ImportError: No module named flask.ext.migrate

即使我可以在本地运行我的应用程序并且我在 requirements.txt 上有烧瓶迁移,你能告诉我为什么我会收到这个错误,我该如何解决?管理.py:

import os
from flask.ext.migrate import Migrate, MigrateCommand
from app import create_app
from flask.ext.script import Manager
from app import db
from app.model import Users

app = create_app(os.environ['FLASK_CONFIG'] or 'default')
magrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)


@manager.command
def init_db():
    db.drop_all()
    db.create_all()


@manager.command
def test():
    from subprocess import call
    call(['nosetests', '-v',
          '--with-coverage', '--cover-package=app', '--cover-branches',
          '--cover-erase', '--cover-html', '--cover-html-dir=cover'])

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

我运行命令 heroku run pip freeze

Running `pip freeze` attached to terminal... up, run.4217
4

0 回答 0