System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Set up Python on IIS 7.5

Last updated on:  2020-10-26

Authored by:  Rackspace Community


Use the following steps to install and set up Python® on Internet Information Services (IIS) 7.5:

  1. Ensure that IIS Common Gateway Interface (CGI) is installed through role services.

  2. Launch IIS Manager by selecting Control Panel > Administrative Tools > Internet Information Services (IIS) Manager.

  3. Click on your website and double-click on Handler Mappings in the center panel.

  4. Click Add Script Map in the Actions box to the right.

  5. In the Add Script Map window, enter *.py as the Request Path, and python.exe as the Executable.

  6. Add the following two parameters at the end of the path:

    -u %s

    The path should have the following format:

    C:\Python27\python.exe -u %s

  7. Give the mapping a name (such as Python) and click OK.

  8. Create a new Python script in your web folder and name it HelloWorld.py.

Note: You need to return a complete HTTP header for your script to work, as shown in the following example:

print "Status: 200 OK"
print "Content-Ty
pe: text/plain;charset=utf-8"

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.