Solved

Pythonoption directive

Posted on 2006-11-27
3
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 …
Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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 …

635 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