Using filepath method to identify an .html page

Michael Torrie torriem at gmail.com
Tue Jan 22 13:21:23 EST 2013


On 01/22/2013 03:07 AM, Ferrous Cranus wrote:
> Now, can you pleas help me write the switch to filepath identifier?
> I'am having trouble writing it.

Unfortunately this isn't the way to go either.  Apache uses its own
config and rules to map a url to a "filepath."  There's no way for
Python to do this without interrogating Apache.  And it's not necessary
anyway.  Urls to paths are mapped in a fairly static way by Apache.
Just put your files in the right folders and generate the appropriate
urls.  It's not hard.  You're struggling because you either don't
understand how apache works, or you're trying to work against it.  I've
been deploying web sites for years and I've never had to do any of the
things you are trying to make Python do.




More information about the Python-list mailing list