mod_python 2.7.10 - publisher

Discussion in 'Python' started by charlie knudsen, Nov 27, 2004.

  1. I am setting up mod_python 2.7.10 on Apache 1.3.33 as a dso and was
    wondering if there is a default function that is called when the publisher
    handler is not given a function. I have read through some documentation
    and it looks like mod_python 3.x defaults to the index function, but that
    does not appear to work for 2.7. Also I am using python 2.3.4.

    I have the following file as index.py in the test directory of my web root:

    from mod_python import apache

    def index(req):
    return "hello world"

    Currently I get the following behavior:

    http://localhost/test/index.py - 404 error
    http://localhost/test/index.py/index - my "hello world" output
    http://localhost/test/index.py/ - I get :
    ----------------------
    Mod_python error: "PythonHandler mod_python.publisher"

    Traceback (most recent call last):

    File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 193, in
    Dispatch
    result = object(req)

    File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 88,
    in handler
    if func_path[-1] == ".":

    IndexError: string index out of range
    ----------------------

    I was wondering if there was a default function in mod_python 2.7.10.

    If not, is there any reasons why I should not add one? Other than the fact
    that the current implementation is well tested.

    Thank you,

    Charlie
     
    charlie knudsen, Nov 27, 2004
    #1
    1. Advertising

  2. charlie knudsen

    charliek Guest


    > I was wondering if there was a default function in mod_python 2.7.10.
    >
    > If not, is there any reasons why I should not add one? Other than the
    > fact that the current implementation is well tested.
    >


    I looked at the source code for the publisher handler and it looks like the
    2.7.x version of mod_python does not default to anything. I just added a
    couple of lines to make it default to the index function.

    Got to love open source!

    Thanks,

    Charlie
     
    charliek, Nov 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anthony Raj
    Replies:
    0
    Views:
    401
    Anthony Raj
    Jun 18, 2004
  2. Nancy
    Replies:
    1
    Views:
    571
    Doug Holton
    Jul 18, 2004
  3. Python_it
    Replies:
    0
    Views:
    503
    Python_it
    Oct 12, 2005
  4. exhuma.twn
    Replies:
    3
    Views:
    346
    exhuma.twn
    Mar 20, 2006
  5. exhuma.twn
    Replies:
    2
    Views:
    532
    exhuma.twn
    Mar 20, 2006
Loading...

Share This Page