Solved

Pythonoption directive

Posted on 2006-11-27
3
157 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IronPython and Visual Studio 2013+ 2 91
Trying to run a Python File 11 63
Python 2.7 - Passing arguments 8 58
Live coding in Python 2.13.0 eclipse plugin security 1 27
Installing Python 2.7.3 version on Windows operating system For installing Python first we need to download Python's latest version from URL" www.python.org " You can also get information on Python scripting language from the above mentioned we…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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 if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now