IIS deployment Python Runtime environment

Source: Internet
Author: User

IIS Deployment

1. Enable or disable Windows features, choose Install CGI, I have installed here.

2. After installation, reopen IIS to see CGI

3. Configuring ISAPI and CGI restrictions

4. Add the upper right corner, the path is the Python installation path, note the addition of two%s%s

Click OK

5. Working with mapping relationships

6. Add module in upper right corner, module selection: CgiModule

A pop-up box appears, point "yes"

Add complete

7. Next Test, create a website

Server-side test code:

1 #!/usr/bin/python2 ImportCGI3 ImportJSON4 #!/usr/bin/python5 #print ("content-type:text/html")6 #print ("")7 #print ("8 #print ("9 #Print ("<p>this page is generated by a Python CGI script.</p>")Ten #print (" One defMain (): A     Print("content-type:text/html\n") -form =CGI. Fieldstorage () -     Print(Form.keys ()) the     Print(Type (form)) -     ifForm.keys () andform["Servicecode"].value! ="": -         Print("", form["Servicecode"].value,"" ) -  +     Else:    -         Print("") +Main ()

Test ok!

IIS deployment Python Runtime environment

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.