我用Flask在virtualbox上建了一个网站.该网站可以在localhost上打开,但我无法通过端口转发打开它,所以我将代码更改manage.run()为manage.run(host='0.0.0.0').
问题是我收到此错误:
typeerror run() got an unexpected keyword argument 'host'.
Run Code Online (Sandbox Code Playgroud)
出现类似的错误时的变化manage.run()来manage.run(debug=True).我只是遵循Flask文档.http://flask.pocoo.org/docs/quickstart/#a-minimal-application有谁能让我知道为什么我收到这个错误?
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Manage Script."""
from sys import stderr, exit
from flask.ext.script import Manager, prompt_bool
from szupa import create_app
from szupa.extensions import db
from szupa.account.models import User
from szupa.context import create_category_db
app = create_app()
manager = Manager(app)
@manager.command
def initdb():
"""Initialize database."""
db.create_all()
create_category_db()
@manager.command
def migrate(created, action="up"):
module_name = "migrates.migrate%s" % created
try:
module = __import__(module_name, …Run Code Online (Sandbox Code Playgroud)