from pyramid.httpexceptions import HTTPFound def redirect(self, url): return HTTPFound(location=url) def set_content_type(self, content_type): self.request.response.content_type = content_type