Skip to content

Example of preparing a server environment on the Windows operating system#

To use IIS (Internet Information Services) as a web server, you have to set up the web.config configuration file, so that IIS can execute Python code correctly. This file is located in your web server publish folder. The language interpreter can be downloaded from the official website.

After installing the interpreter, you should specify the HttpPlatform handler in the web.config file. This handler will pass connections to the offline Python process.

Configuration file example:

<?xml version="1.0" encoding="utf-8"?>
      <add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
    <httpPlatform processPath="<Path-to-python>\python.exe"
        <environmentVariable name="SOME_VARIABLE" value="%SOME_VAR%" />

"\<Path-to-python>" - path to the Python interpreter executable file

"\<Path-to-server-file>" - path to the server executable file (for instance, from the library example)

"\<Path-to-log-file>" - path to the log file

Besides you will have to open the relevant port to the external network by configuring the firewall settings (Advanced settings -> Inbound Rules -> Create a rule -> Rule type = Port, Protocols and port -> TCP, specify port, Action -> Allow connection)