项目部署 ubuntu Django uwsgi配置
1.进入项目文件夹
mkdir uwsgi_file
vim uwsgi.ini
写入保存
1 [uwsgi] 2 3 chdir = /home/mysite/my_project # 项目目录 4 module = my_project.wsgi:application # wsgi所在目录 5 # home = /root/.virtualenvs/mywork # 虚拟环境目录 缺省 6 7 master = true # 主进程 8 processes = 4 # 进程数 9 harakiri =60 10 max-requests = 5000 11 12 13 14 socket=127.0.0.1:8001 #端口 15 # http=127.0.0.1:8001 16 uid = 1000 17 gid = 2000 18 pidfile =/home/mysite/my_project/uwsgi_file/uwsgi.pid 19 daemonize = /home/mysite/my_project/uwsgi_file/uwsgi.log #日志 20 vacuum = true 后台开启 21 22 23
2.重启Nginx
service nginx restart
3.开启setting debug = True
4.启动uwsgi
启动 uwsgi --ini uwsgi.ini (路径) 停止:ps -aux | grep uwsgi |awk '{print $2}'|xargs kill -9
5.成功(显示Django欢迎界面)