时间:2023-06-09 23:15:01 | 来源:网站运营
时间:2023-06-09 23:15:01 来源:网站运营
Flask网站模板(python + flask + LayUI + mysql):Flask网站模板
python + flask + LayUI + mysql
export FLASK_APP=hello.py
create database test_db charset=utf8;
flask db initflask db migrateflask db upgrade
# 初始化用户数据flask init-tables
python hello.py
gunicorn
& gevent
pip install gunicornpip install gevent
gunicorn
启动服务cd MyWebserver-flaskgunicorn -c gunicorn.conf.py hello:app --preload -b 0.0.0.0:5000# 后台启动gunicorn -c gunicorn.conf.py hello:app --preload -b 0.0.0.0:5000 --daemon
ps -ef|grep gunicorn
roger 12434 1 0 15:15 ? 00:00:02 ...... -b 0.0.0.0:5000 --daemonroger 12442 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12443 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12444 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12445 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12446 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12447 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12448 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12449 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemonroger 12450 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
kill -9 12434
# 访问日志tail -f ~/log/gunicorn_access.log# 接口日志tail -f ~/log/gunicorn_info.log
关键词:模板