求大神帮助 gunicorn 开不起来
flask吧
全部回复
仅看楼主
level 2
ssy114114 楼主
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 跑不起来
2023年06月12日 07点06分 1
level 2
ssy114114 楼主
[2023-06-12 15:37:53 +0800] [3649] [INFO] Starting gunicorn 20.1.0
[2023-06-12 15:37:53 +0800] [3649] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2023-06-12 15:37:53 +0800] [3649] [ERROR] Retrying in 1 second.
[2023-06-12 15:37:54 +0800] [3649] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2023-06-12 15:37:54 +0800] [3649] [ERROR] Retrying in 1 second.
[2023-06-12 15:37:55 +0800] [3649] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2023-06-12 15:37:55 +0800] [3649] [ERROR] Retrying in 1 second.
[2023-06-12 15:37:56 +0800] [3649] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2023-06-12 15:37:56 +0800] [3649] [ERROR] Retrying in 1 second.
[2023-06-12 15:37:57 +0800] [3649] [ERROR] Connection in use: ('127.0.0.1', 5000)
[2023-06-12 15:37:57 +0800] [3649] [ERROR] Retrying in 1 second.
[2023-06-12 15:37:58 +0800] [3649] [ERROR] Can't connect to ('127.0.0.1', 5000)
2023年06月12日 07点06分 2
level 6
看下5000端口,先本地flask run,再连接试试
2023年06月12日 12点06分 3
1