[mod_python] how do I eliminate the .py extension in url?

Chris Jackson christopher.jackson at gmail.com
Thu Feb 10 16:34:21 EST 2005


If you rename my_script.py to index.py, you can just reference your
handler like this:

/scripts/my_handler

~= Chris =~

On Thu, 10 Feb 2005 12:53:02 -0800 (PST), Jef Dodson
<jefdodson at yahoo.com> wrote:
> I'm having a problem getting mod_python to work with url's that don't include the .py extension.
> Here's what I would like to do:  I would like to keep the .py extension on my files, but not
> include them in the url.  So, if I have my_script.py in my scripts directory, I would like to be
> able to reference that function in the url as /scripts/my_script/my_handler, i.e., no my_script.py
> in the url.  Here is the relevant section from my apache config file:
> 
> <Directory /var/www/my_site.com/scripts>
>     SetHandler mod_python
>     PythonHandler mod_python.publisher
>     PythonDebug On
> </Directory>
> 
> Is there something else that I need that I'm missing?  Thanks!
> 
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list