Start the Uwsgi service in HTTP form

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.