Solved

Pythonoption directive

Posted on 2006-11-27
3
158 Views
Last Modified: 2011-04-14
hi,
im trying to read thevalues from pythonoption directive in httpd.conf , and i have used this

options = req.get_options()

which python package needs to be import to use the above code?

I suppose its
from mod_python import apache

But in my machine, it cannt seem to find that package. How do i install the package. I m using debian linux


thanks


0
Comment
Question by:jyotishb
3 Comments
 
LVL 15

Accepted Solution

by:
mish33 earned 500 total points
ID: 18025564
That package is only available to python scripts running under apache (mod_python) hadler.

from mod_python import apache

def handler(req):

    req.content_type = "text/plain"
    options = req.get_options()
    for opt in options.iteritems():
        req.write("%s=%s" % opt)

    return apache.OK

See http://www.ics.uci.edu/~sources/apache/mod_python/tut-what-it-do.html

Also see http://www.ics.uci.edu/~sources/apache/mod_python/installation.html
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"The time has come," the Walrus said, "To talk of many things: Of sets--and lists--and dictionaries-- Of variable kinks-- And why you see it changing not-- And why so strange are strings." This part describes how variables and references (see …
Introduction On September 29, 2012, the Python 3.3.0 was released; nothing extremely unexpected,  yet another, better version of Python. But, if you work in Microsoft Windows, you should notice that the Python Launcher for Windows was introduced wi…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question