| Store | Cart

how to write python server page by using mod_python?

From: Robert Brewer <fuma...@amor.org>
Thu, 4 Mar 2004 22:09:27 -0800
wenming_hu wrote:
> i want to set the default page of a site, the same as writing > asp or jsp.

Use the DirectoryIndex option to set a default page. See my example
below.

> er, i have a another question, i want to put my site in a separate> directory, (for example, e:\psp_site), i put the following in apache's> config:> > <Directory "f:/psp_site/">> >     AddHandler python_program .py>     PythonHandler main> >     PythonAutoReload On>     PythonDebug On> > </Directory>> > but to my disappointed, it doesn't work! :-(

Here's a sample .conf section for an app I'm working on. Notice that I
do not use .py files--I think it's silly for the user to know or care
about how we created the page--I use .htm or .html

In the directory D:\htdocs\junct, I have topic.htm, and dispatch.py. The
PythonOption lines are a way for me to pass "global data" into my
program.

----interface.conf----

Alias /junct D:\htdocs\junct

<Directory D:\htdocs\junct>
  AddHandler python-program .htm
  PythonHandler dispatch
  PythonOption namespace junct.namespace
  PythonOption ConfigFiles
C:\Python23\Lib\site-packages\junct\default.conf,D:\data\junct\junct.con
f
  PythonDebug On
  
  DirectoryIndex topic.htm
</Directory>

----end interface.conf----


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org

Recent Messages in this Thread
Robert Brewer Mar 05, 2004 06:09 am