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