#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    65
    Rep Power
    11

    Mod_python handler problems.


    I am trying to write a custom mod_python handler.

    I use the fallowing .htaccess file:

    SetHandler mod_python
    PythonHandler myHandler
    PythonDebug On

    My script is the following:

    from mod_python import apache
    import os
    def handler(req):

    if os.path.exists(req.uri):
    req.write("We exist")
    else:
    req.write("We dont exist")
    return apache.OK

    The problem I have is that if the request isn't made to mysite.com/myHandler it downloads the script output instead of printing the output to the browser. Either way the output is correct so I know the script is working correctly. Any ideas why it would be downloading the output instead of printing it?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Atlantic City, NJ
    Posts
    327
    Rep Power
    13
    Well what did you change in the handler?
    I'll learn this stuff someday.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    65
    Rep Power
    11
    It is mod_python. I used the word custom as aposed to the provided publisher handler. Custom is normal, I think its more apache problem then python.

IMN logo majestic logo threadwatch logo seochat tools logo