I found issues like this as well and read the same thing.  Absolute
links feel very unpythonic/un-unixy and it's definitely bad practice.

>From what I understand it's a problem with the balance of maintaining
backwards compatibility and the new WSGI environment.

Hopefully it can be fixed in TG2. :P

- Julian

On Mar 15, 10:34 am, Ben Sizer <[email protected]> wrote:
> I have an 'admin' subcontroller off my root controller. This has an
> 'index' controller. The HTML for the index contains several relative
> links to other methods on the admin controller.
>
> Usually this page will be reached viahttp://localhost/admin/.
> Unfortunately it can also be reached byhttp://localhost/admin(no
> trailing slash) which means relative links break with the browser
> trying to find them off the root. This can be fixed by using the
> with_trailing_slash decorator, which appends the trailing slash,
> meaning /admin redirects to /admin/. All well and good.
>
> But now you get the other problem - although /admin/ works, /admin/
> index now redirects to /admin/index/, meaning all the relative links
> now look for a non-existent 'index' controller.
>
> Ideally I'd like to find a way to serve up the admin index page so
> that it will always appear at the same level in the URL hierarchy. I
> don't want it to be possible to display that (or indeed any other)
> controller in more than one level of the URL hierarchy. Is this
> possible?
>
> I would prefer not to have to change everything to using absolute
> URLs. There's a hint 
> athttp://www.turbogears.org/2.0/docs/main/Controllers.html#subcontrolle...
> that absolute URLs are preferred, but that is a shame as relative URLs
> are typically shorter and easier to maintain.
>
> --
> Ben Sizer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to