[mod_python] importing module

Luis M. Gonzalez luismg at gmx.net
Sat Apr 1 13:44:14 EST 2006


I've been trying to solve an import problem, and I came across a strange behaviour when using firefox or opera as web browser.
This is the script:

    #myscript.py
    from utils import table
    import MySQLdb
    con = MySQLdb.connect('localhost','root','','vic')
    cur = con.cursor()
    cur.execute('select * from clientes')

    def index(req):
        req.content_type='text/htm'
        req.write(table(cur))

"utils.py" is a module placed in htdocs directory which contains a function for representing tabular data.

The problem I see is that when trying to access http://localhost/myscript.py,  I get an "Open" dialog in my browser, prompting me to open or save the file on disk.
It doesn't happend when using Internet Explorer, which works fine.

What is the problem?
This is my http.conf configuration:

    <Directory "C:/Archivos de programa/xampp/htdocs">
    AddHandler python-program .py .psp
    PythonHandler mod_python.publisher | .py
    PythonHandler mod_python.psp | .psp
    </Directory>

I would appreciate a hint to solve this...
Thanks in advance!
LUIS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060401/e6455b28/attachment.html


More information about the Mod_python mailing list