473,804 Members | 3,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mod_python 2.7.10 - publisher

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: "PythonHand ler mod_python.publ isher"

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

Jul 18 '05 #1
1 2412
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

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1607
by: Julien Cigar | last post by:
Hello, I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the publisher handler and the Clearsilver template engine, and from time to time apache returns an 500 error code (Internal Server Error). Apache errog.log file looks like : PythonHandler mod_python.publisher: Traceback (most recent call last): PythonHandler
0
1806
by: Python_it | last post by:
I'm going to work with mod_python. I install mod_python 3.2.2b for python 2.4. If i test my install with mptest.py see this link: http://www.modpython.org/live/mod_python-3.2.2b/doc-html/modpython.html IT WORKS!
6
3665
by: Little | last post by:
I can't figure out how to build this type of program using the publisher handler. I have the following connected to the program SetHandler python-program PythonHandler mod_python.publisher PythonDebug On But what I would like to do would be have a german word as the parameter in the HTTP request and have the english world printed out on the screen. Yes this will be a small dictionary but I just want to be able to understand how to...
6
1949
by: Anthony L. | last post by:
I am writing a web application that is comparable to a content management system used in blogging. I really want to use Python after having done some evaluation coding using Python 2.3.5 with mod_python 3.1.4 running on Apache 2.0 with the Publisher handler. However, I am still very hesitant to settle on Python. All my research brings up the same collection of scant articles and old mailing list messages that reference each other. I am...
2
3316
by: exhuma.twn | last post by:
Hi again, as soon as I try to make use of the "session" object inside a psp-template file, I get the following error: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
2
3236
by: m.banaouas | last post by:
I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform I configured mod_python via httpd.conf: LoadModule python_module modules/mod_python.so but my script folder configuration doesn't work correctely: Alias /myfolder D:/myfolder <Directory "/myfolder"> Order allow,deny
1
1981
by: jpuopolo | last post by:
Hi, all... I am hoping that someone can help me with the magic incantation to get mod_python working on my local machine. Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity me). I've gotten the basic mptest.py handler to work with no problem. I am now trying to use the mod_python.publisher, but when I do, I get a 404
0
1746
by: Simo D | last post by:
Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req)
0
2363
by: Simo D | last post by:
Ok, solved: apache is unable to follow relative paths from the script. Putting ol absolute paths it's ok! Simo D wrote: -- View this message in context: http://www.nabble.com/Mod_python-permission-denied-tp20377387p20378315.html Sent from the Python - python-list mailing list archive at Nabble.com.
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.