/home/zhang/Graduation/uwsgi.ini文件
[uwsgi]
socket = 127.0.0.1:5678
chdir = /home/zhang/Graduation
wsgi-file = manage.py
callable = app
process = 2
threads = 2
status = 127.0.0.1:8765
/etc/nginx/conf.d/flaskapp.conf文件
server {
listen 80;
server_name www.zhang21.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:5678;
}
}
启动Nginx、uwsgi
service nginx start
uwsgi uwsgi.ini
可以选择把数据库更换为 MongoDB
或者 MySQL
Python 连接 MongoDB 的库 "pymongo"
Python 连接 MySQL 的库 "pymysql"
Python 连接 Redis 的库 "redis"