Wsgi和uwsgi
Wsgi和uwsgi
WSGI(Web Server Gateway Interface)是一种规范,它定义了使用python编写的web app(应用程序)
与web server(socket服务端)之间接口格式,实现web app与web server间的解耦。
包括uwsgi
wsgi主要用于在Windows上启动django服务
uwsgi主要用于在Linux上启动django服务,
需要配置uwsgi.ini文件
这个文件叫做 uwsgi.ini #手动创建这个配置文件,写入如下信息 [uwsgi] # Django-related settings # the base directory (full path) #这里写入项目的绝对路径 chdir = /opt/Ace_crm # Django's wsgi file #写入django的第二层文件夹,和wsgi.py文件 module = Ace_crm.wsgi # the virtualenv (full path) #虚拟环境的绝对路径 home = /root/Envs/crm # process-related settings # master master = true # maximum number of worker processes processes = 5 #如果你没用nginx,想直接访问django后台,可以使用http协议 #http = 0.0.0.0:8000 #如果你用了nginx进行反向代理,请使用socket协议,注释掉http协议 socket = 0.0.0.0:8000