#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Germany
    Posts
    10
    Rep Power
    0

    newbie needs help with mod_python


    Hiya,

    I just installed python 2.3, the lastest stable apache2 and the latest mod_python.

    I just want to write a little "hello world"-script to check if mod_python is installed in the right way. So I used the mod_python-example for this script

    from mod_python import apache

    def handler(req):
    req.write("Hello World")
    return apache.OK
    but I get an error 500 all the time and the apache error-log present this line
    [Fri Aug 29 23:00:18 2003] [error] make_obcallback: could not call init.
    Maybe the directory-entry in the httpd.conf is wrong, but I'm very new at administer an server

    <Directory "D:/Programme/Apache Group/Apache2/Apache2/htdocs/python">
    AddHandler python-program .py
    PythonHandler mptest
    PythonDebug On
    </Directory>
    What does the python-handler mean? Do I have to add a handler for every new file? Can't believe it

    Every help would be very nice. Maybe somebody have a link to a mod_python-tutorial?

    Thank you
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    bah I had to go through hell trying to get mod_python to work when I had Python 2.2, I don't even bother with 2.3, nothing works for me.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I have to agree with 2k's statment about going though hell with mod_python. I've tired so many times to get it working and finally just gave up (for now). You obviously got further than me as I couldn't even get Apache to start up once i'd finished following there intallation instructions . I even tried suing the windows installer, same deal.

    I'd just stick to CGI when using Python for web programming.. at least for now, maybe in the future they will make it easier to handle i'll reconsider my oppion.

    2k, Python 2.3 is (at least in my oppion) much better than 2.2 (and I was/am very happy with 2.2), definatly worth the upgrade! I've got no complains so far at all.. infact there is only one thing i was expecting to see but having and thats a function to check a variables existance (similar to PHP and isset) maybe next time.

    Sorry, i know this isn't much help,
    Mark.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Germany
    Posts
    10
    Rep Power
    0
    So did I understood you correctly, that mod_python is very hard to handle? Hm thats bad I want to learn Python and I did learn other programming languages using their web-abilities, beacuse this is the most usefull for me But thanks for the info, that I'm not alone with my problems
  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    well you can use Python for CGI in just about the same way as mod_python, it's not as powerful when it comes to interacting with the server and it's a tad slower but other than that the two are the same.. it's my fav' way of working with Python on the web without heading into Zope and ect.

    Wana use Python like PHP, check out Spyce at http://spyce.sourceforge.net/

    Mark.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    Originally posted by netytan
    I have to agree with 2k's statment about going though hell with mod_python. I've tired so many times to get it working and finally just gave up (for now). You obviously got further than me as I couldn't even get Apache to start up once i'd finished following there intallation instructions . I even tried suing the windows installer, same deal.

    I'd just stick to CGI when using Python for web programming.. at least for now, maybe in the future they will make it easier to handle i'll reconsider my oppion.

    2k, Python 2.3 is (at least in my oppion) much better than 2.2 (and I was/am very happy with 2.2), definatly worth the upgrade! I've got no complains so far at all.. infact there is only one thing i was expecting to see but having and thats a function to check a variables existance (similar to PHP and isset) maybe next time.

    Sorry, i know this isn't much help,
    Mark.
    I was talking about giving up trying to get mod_python to work with Python 2.3. I already upgraded when the Python 2.3 came out.
  12. #7
  13. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Sorry, my mistake 2k..

    Mark.

IMN logo majestic logo threadwatch logo seochat tools logo