We will introduce how to configure the Python CGI Environment in different operating systems. I believe most developers are eager to master this application technology. Next, let's take a look at the specific application methods.
- Detailed description of the correct Python case
- How to automatically download Python files
- Tips for reading input values from Python
- In-depth discussion on the correct application of the Python ConfigParser Module
- How to Use Python to decrypt the basic VBS application code
CGI stands for the COMMON Gateway Interface (Public Gateway Interface), which describes the Interface specifications between the Web server and Web programs, allowing users to execute Web programs through the Web server, and return the result to the browser through the Web server.
The main difference with traditional programs is that the input and output are different. The input of traditional desktop programs mostly comes from the keyboard, the standard input of the Python CGI program is obtained by environment variables and materials in special formats. The standard output of traditional programs is displayed on the console screen, the CGI program generates HTML content or information that can be received by other browsers to the Web server, and then the Web server returns the information to the browser.
Configure the Python CGI Environment on Windows 98
1. Install pws
2. Install Python
3rd, run regedit.exe
4. The key to accessing the Registry (Script_Map) is as follows:
- HKEY_LOCAL_MACHINE
- System
- CurrentControlSet
- Services
- W3Svc
- Parameters
- Script_Map
5. Create a New String Value ". cgi" for Script_Map"
6. assign a value for ". cgi" "C:" python "python-u % s"
7. Restart your computer
After the above steps, you have configured the python cgi Environment on Windows 98.
Now you can put the python script with the extension. cgi in the relevant directory (such as cgi-bin) and execute it in the browser.
Configure the Python CGI Environment on IIS in Windows 2000
1. Start --> program --> Management --> Internet service management;
2. Choose site> Properties> WWW Service> Edit> Home directory> Configuration> application ing;
3. Click "add" to bring up a dialog box;
4. Fill in C: "Python24" python.exe-u "% s" "% s" in the "executable" text box, and fill in the "extension" text box. cgi: click "OK. You can also configure it in the registry like Windows 98.
Configure the Python CGI Environment on IIS in Windows 2003
It is basically the same as that on Windows 2000, but because Windows 2003 IIS6 has strict permission control, you must set additional security-related environments and open the CGI program permission, all unknown CGI extensions must be "Allowed" in the Internet Information Service (IIS) manager.