Uwsgi Yourfile.ini # configuration file
[Uwsgi]
HTTP = 127.0.0.1:3106
Socket = 127.0.0.1:3006
ChDir =/www/studentapitest/zhishidian
Pythonpath =/www/studentapitest/
env = Django_settings_module=zhishidian.linux_settings
module = Django.core.handlers.wsgi:WSGIHandler ()
Workers = 4
Max-request = 2000
Master = True
Harakiri = 30
Pidfile =/www/config/studentapitest.tbkt.cn.pid
Touch-reload =/www/config/studentapitest.tbkt.cn.reload.txt
Daemonize =/www/logs/studentapitest.tbkt.cn.uwsgi.log
After adding the HTTP parameters can be accessed in HTTP form, configured and start the Uwsgi service, in the browser input http://127.0.0.1:3106 can be directly accessed, so that the advantages of the configuration can be directly accessed by the program, 3006 and 31,062 ports are running inside a process
The following Python code fragment
Import Urllib2
res = Urllib2.urlopen ("http://127.0.0.1:3106/login/")
Print Res.read ()
Nginx can be accessed in socket form
Location/{
Uwsgi_pass 127.0.0.1:3106;
Include Uwsgi_params;
}
More Usage Reference official documentation
Http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html#deploying-django
Http://uwsgi-docs.readthedocs.org/en/latest/HTTP.html
Start the Uwsgi service in HTTP form