from pyramid.httpexceptions import HTTPFound from pyramid.view import view_config @view_config( context='ordr.resources.RootResource', permission='view', ) def welcome(context, request): ''' web root redirects ''' if request.user: redirect_to = request.resource_url(context, 'orders') else: redirect_to = request.resource_url(context, 'account', 'login') return HTTPFound(redirect_to) @view_config( context='ordr.resources.RootResource', name='faq', permission='view', renderer='ordr:templates/pages/faq.jinja2' ) def faq(context, request): ''' displays the FAQ page ''' return {}