generating method names 'dynamically'

Magnus Lycka lycka at carmen.se
Fri Jan 27 09:56:46 EST 2006


Daniel Nogradi wrote:
> Well, I would normally do what you suggest, using parameters, but in
> the example at hand I have to have the method names as variables and
> the reason is that the whole thing will be run by apache using
> mod_python and the publisher handler. There a URL
> http://something.com/program2/Bob is mapped to the 'Bob' method of the
> file program2.py and I want to be able to have URL's with different
> names. I know I can solve this problem with parameters and functions
> and using the GET http method, but I would like to have pretty URL's
> without & and ? signs. I didn't want to ask this on the mod_python
> list because after all it's a pure python question.

Ouch! This certainly seems like a possible security hole!

As someone else said, use rewrite rules to get this passed
in as a parameter.



More information about the Python-list mailing list