yes, I think so:

from webapi.py:

class Redirect(HTTPError):
    """A `301 Moved Permanently` redirect."""
    def __init__(self, url, status='301 Moved Permanently', absolute=False):
        """
        Returns a `status` redirect to the new URL.
        `url` is joined with the base URL so that things like
        `redirect("about") will work properly.
        """
        newloc = urlparse.urljoin(ctx.path, url)

        if newloc.startswith('/'):
            if absolute:
                home = ctx.realhome
            else:
                home = ctx.home
            newloc = home + newloc

        headers = {
            'Content-Type': 'text/html',
            'Location': newloc
        }
        HTTPError.__init__(self, status, headers, "")

redirect = Redirect

class SeeOther(Redirect):
    """A `303 See Other` redirect."""
    def __init__(self, url, absolute=False):
        Redirect.__init__(self, url, '303 See Other', absolute=absolute)

seeother = SeeOther


--
Best Regards
----
My Chaos: http://n23.appspot.com



On Sat, Jul 4, 2009 at 17:02, Zhang Huangbin<[email protected]> wrote:
>
> Hi, list.
>
> Just want to confirm it:  will webpy append web.ctx.homepath automatic
> in web.seeother()?
>
> My code is deployed in http://server/myproj/
> It will redirect to http://server/myprog/dashboard these two ways:
>
>   - web.seeother(web.ctx.homepath + '/dashboard')
>   - web.seeother('/dashboard')
>
> Tested on both apache + mod_wsgi and webpy build-in web server.
>
>
> --
> Best Regards.
>
> Zhang Huangbin
>
> - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux,
>   CentOS, Debian, Ubuntu:
>   + http://code.google.com/p/iredmail/
>   + http://www.iredmail.org/forum/
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to