uwsgi 官方文档:Python/WSGI 应用快速入门 — uWSGI 2.0 文档
安装uwsgi:
pip install uwsgi
在【项目】目录下,manage.py 同级目录创建: myweb_uwsgi.ini 文件 (名字随便起)
myweb_uwsgi.ini 内容配置:
[uwsgi]
# 使用nginx链接时配置 socket Django连接时默认使用socket 80 端口。如果使用80端口,先检查80端口是否被占用。
socket = 192.168.64.131:8000# 直接做web服务器使用时配置
# http = 192.168.64.131:8000# 项目目录路径
chdir = /home/ProjectName/# 项目中wsgi.py文件的目录,相对于项目目录
module = partner.wsgi:application
# wsgi-file = myproject/wsgi.py# process-related settings
# master
master = true# maximum number of worker processes
processes = 4# ... with appropriate permissions - may be needed
# chmod-socket = 664
# clear environment on exit
vacuum = truedaemonize = /home/lin/Desktop/lin/code/workspace/partner/uwsgi_log.logpidfile = /home/lin/Desktop/lin/code/workspace/partner/uwsgi_pid.log
更多资源请参考:【Django2.0教程】39.用Nginx+uWSGI部署_哔哩哔哩_bilibili
GitHub - HaddyYang/django2.0-course: Django2.0视频教程相关代码(杨仕航)