Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pythonoption directive

Posted on 2006-11-27
3
Medium Priority
?
165 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
1 Comment
 
LVL 15

Accepted Solution

by:
mish33 earned 2000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
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 modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

876 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