[Moin-user] Re: Problems with moin + mod_python

Paul Moore paul.moore at atosorigin.com
Sun Jun 6 15:13:03 EDT 2004


Paul Moore <paul.moore at atosorigin.com> writes:

> Paul Moore <pf_moore at yahoo.co.uk> writes:
>
>> I have a minor problem, though. When I navigate to
>> http://ukdcr030:8000/dbawiki/, I get the front page, as expected.
>> However, if I then click on a link, say BackupAndRecovery, I get
>> shown the front page *again*, but with a URL of
>> http://ukdcr030:8000/dbawiki//BackupAndRecovery in the address bar
>> (note the double slash in the middle). Hitting the same link again
>> takes me to the right page, but with a URL of
>> http://ukdcr030:8000/dbawiki//BackupAndRecovery/BackupAndRecovery.
>
> I think I've found out what the issue here is.

Not quite. Page.url() uses request.getScriptname(). But the "script
name" doesn't make sense to mod_python.

The whole script name/path info concept doesn't make sense for
mod_python, and (AFAICT) that has some pretty major implications.

I can "fix" the problem by redefining 2 methods of RequestmodPy:

    def getScriptname(self):
        """ Return the scriptname part of the URL ('/path/to/my.cgi'). """
	return "/wiki"

    def getPathinfo(self):
        """ Return the remaining part of the URL. """
	return self.mpyreq.uri[5:]

But that only works because I hardcoded the path to the Wiki front
page (and its length). And the problem is that I can't derive that
from scratch. I can pass it in from the Apache configuration, via the
PythonOption directive and the req.get_options() method, but that just
hardcodes the URL in a different place :-(

Paul.
-- 
This signature intentionally left blank





More information about the Moin-user mailing list