core.redirect

Simple redirects for renamed paths using a generic redirect model.

For static paths:

@App.path('/old-path')
class OldPathRedirect(Redirect):
    to = '/new-path'

For wildcard paths (e.g. /old-pages/my-page to /new-pages/my-page):

@App.path('/old-path', absorb=True)
class OldPagesRedirect(Redirect):
    to = '/new-pages

Classes

Redirect

Functions

view_redirect(→ webob.Response)

Module Contents

class core.redirect.Redirect(absorb: str | None = None)[source]
to: str[source]
core.redirect.view_redirect(self: Redirect, request: core.request.CoreRequest) webob.Response[source]