[mod_python] [SPAM] URL returned by test.py

Graham Dumpleton graham.dumpleton at gmail.com
Sat Nov 10 16:40:29 EST 2007


Also read:

  http://www.modpython.org/pipermail/mod_python/2006-March/020501.html

Can't remember though if I posted a slightly more updated version of
that code though. It may have a slight error in it from memory.

Graham

On 11/11/2007, Jorey Bump <list at joreybump.com> wrote:
> Peter Hollenbeck wrote, at 11/09/2007 09:25 PM:
>
> > I open http://localhost/test.html
> > Test.html calls test.py
> > Test.py returns an html page with a link to an image in
> > /srv/www/htdocs/pics/1998/...
> > But the link displayed in the browser is
> >     http://localhost/test/test.py/pics/1998/...
> > not
> >     http://localhost/pics/1998/...
> >
> > Can anyone tell me why this is?
>
> You are using a relative path.
>
> > What can I do to get the link without "/test/test.py"
>
> Use an absolute path from the site root.
>
> Change this:
>
> >     link = '<a href="pics/1998/9804/bcsi/98042118.jpg"><img
> > src="pics/1998/9804/bcsi/98042118tn.jpg">Logging road</a>'
>
> To this:
>
>      link = '<a href="/pics/1998/9804/bcsi/98042118.jpg"><img
> src="/pics/1998/9804/bcsi/98042118tn.jpg">Logging road</a>'
>
> This problem would occur using any language. It's not specific to
> mod_python. The browser will treat relative paths as relative from the
> currently displayed page.
>
>
> _______________________________________________
> 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