[mod_python] My .py won't some up for the blient

Bradley Hintze bradley.h at aggiemail.usu.edu
Thu Jun 24 09:37:50 EDT 2010

Hi all,

Newbie question. I was hoping to have template HTML at the beginning
of my .py script and the end. I can't get it to work. Here is what I

destroy_confirm.py =

import HTML_template
  <table width = 550 cellpadding = 10 bgcolor=white>
    <tr><td><center>This action will delete all your session files.
        <form  action="destroy_LogOut.psp" method="">
        <center><input type="submit" value="Run MolProbity Compare"></center>'''

HTML_template.py =

def start():
    start= '''\
<link rel="stylesheet" type="text/css" href="style.css" />
  <table width = 1024 cellpadding = 10>
    <tr><td valign = top>Molprobity Compare<br /><br /><br />
                    <a href ="destroy_confirm.psp">Log Off</a>
            <table width = 850 cellpadding = 10>
                <tr><td colspan = 2><center><h1>MolProbity Compare</h1></center>
                <tr><td colspan = 2>Molprbity Compare will allow you
to compare Molprobity parameters
                    for two different structures. The program will
highlghit important
                    differences between the two.
    return start

def end():
    end = '''\
    return end

Handlers in httpd.conf  =

<Directory /Library/WebServer/Documents>
    AddHandler mod_python .py .psp .psp_
    <FilesMatch "\.(psp|psp_)$">
	PythonHandler mod_python.psp
	<Files *.py>
	PythonHandler mod_python.publisher
    PythonDebug On

I hope this isn't too much to ask.  Any ideas?

Bradley J. Hintze
Graduate Student
Duke University
School of Medicine

More information about the Mod_python mailing list