Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:14:33+00:00 2026-05-22T12:14:33+00:00

I have run into a problem while deploying a web.py single-file API on IIS

  • 0

I have run into a problem while deploying a web.py single-file API on IIS 7 via PyISAPIe. I am going to talk about that today.

I have successfully been able to deploy several Django web applications on IIS 7 using PyISAPIe. The Isapi.py module that I used for the Django sites looks similar to this:

from django.core.handlers.wsgi import WSGIHandler as DjangoHandler
from Http.WSGI import RunWSGI
from Http import Env
import os
import sys
sys.path.append(r"C:\projects\myproject")
os.environ["DJANGO_SETTINGS_MODULE"] = "myproject.settings"
Base = "/"
Exclude = ["/media"]
Handler = DjangoHandler()

def Request():
  PathInfo = Env.PATH_INFO
  return RunWSGI(Handler, Base=Base)

However, not knowing how to tweak the above to use with my web.py script, I started with the WSGI example Isapi.py file. After additions, I have the following file:

from Http.WSGI import RunWSGI
from Http import Env
from md5 import md5
import imp
import os

import sys
sys.path.append(r"C:\projects\otherproject\")

SCRIPT_PATH = 'C:\projects\otherproject\device_api.py'
ScriptHandlers = {
     "/": r"C:\projects\otherproject\device_api.py",
}
def RunScript(Path):
  global ScriptHandlers
  try:
    return ScriptHandlers[Path]()
  except KeyError:
    Name = '__'+md5(Path).hexdigest().upper()
    ScriptHandlers[Path] = \
      imp.load_source(Name, Env.SCRIPT_TRANSLATED).Request
    return ScriptHandlers[Path]()

Apps = {
#  "/app/django/"  : lambda P: RunWSGI(DjangoHandler()),
#  "/app/trac/"    : lambda P: RunWSGI(TracHandler),
  "/" : lambda P: RunScript(P),
}

def Request():
  Name = Env.SCRIPT_NAME
  for App, Handler in Apps.items():
    if Name.startswith(App):
        return Handler(Name)
  raise Exception, "Handler not found."

I am sure that there is something that I am overlooking or plainly doing wrong. When I try to access the script on the browser, I get a 500 response from IIS with the following details:

Could not initialize interpreter

Traceback (most recent call last):
  File "C:\projects\pyisapie\Http\Isapi.py", line 29, in 
    from md5 import md5
  File "C:\Python26\Lib\md5.py", line 8, in 
    DeprecationWarning, 2)
  File "C:\Python26\Lib\warnings.py", line 29, in _show_warning
    file.write(formatwarning(message, category, filename, lineno, line))
Exception: Not currently processing a request

While I am still playing around with different tweaks and such, I am not exactly sure what I need to do to get it working. Any help in that direction will be really greatly appreciated.

Thank you for your time.

PS: I have this script, device_api.py, deployed under Apache2 using mod_wsgi, so I am certain there is nothing wrong with the code inside the script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:14:34+00:00Added an answer on May 22, 2026 at 12:14 pm

    After labouring for days, I finally found a solution. I wrote it down in detail. I am going to provide a link to my blog post where I have put it down. It’s titled, “Guide: Deploying web.py on IIS7 using PyISAPIe“. I hope it helps someone facing similar issues.

    Thank you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SWFUpload to handle file uploads and have run into a problem where
I have run into a problem while writing my server program. I need to
I'm creating a file-browser in ASP.Net but I have run into a problem which
I seem to have the luck to run into the funniest problems while deploying
I have run into a problem while writing C++ code that needs to compile
I have run into this problem before but never quite solved it. I have
I have run into a problem trying to modify a form I myself have
I have run into a problem w/ my model for databinding in WPF. I
I have run into a problem... I'm trying to use QTKit in an application
it seems I have run into a problem with Internet Explorer 7. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.