from flask import Flask
import config
from exts import db
from apps.cms import bp as cms_bp
from apps.common import bp as common_bp
from apps.front import bp as front_bp
from flask_wtf import CSRFProtect
def create_app():
app = Flask(__name__)
# 配置信息
app.config.from_object(config)
# 注册蓝图
app.register_blueprint(cms_bp)
app.register_blueprint(front_bp)
app.register_blueprint(common_bp)
db.init_app(app)
CSRFProtect(app)
return app
if __name__ == '__main__':
app = create_app()
app.run(port=5000)
# app.run(host='0.0.0.0', port=8080)
我在终端中输入gunicorn -w 1 -b 127.0.0.1:5000 --access-logfile ./logs/log main:app 跑不起来
import config
from exts import db
from apps.cms import bp as cms_bp
from apps.common import bp as common_bp
from apps.front import bp as front_bp
from flask_wtf import CSRFProtect
def create_app():
app = Flask(__name__)
# 配置信息
app.config.from_object(config)
# 注册蓝图
app.register_blueprint(cms_bp)
app.register_blueprint(front_bp)
app.register_blueprint(common_bp)
db.init_app(app)
CSRFProtect(app)
return app
if __name__ == '__main__':
app = create_app()
app.run(port=5000)
# app.run(host='0.0.0.0', port=8080)
我在终端中输入gunicorn -w 1 -b 127.0.0.1:5000 --access-logfile ./logs/log main:app 跑不起来