문제

So I have a pyramid web app and authentication is working great. If a user has not logged in and tries to visit a certain route, then are redirected to the login page. Now, however, I have a route that I would like to add for which I want to make sure that authentication is not required. For this route only, I would like the view to be rendered even if the user has not logged in. How can I accomplish this?

도움이 되었습니까?

해결책

@view_config(route_name='home', permission=pyramid.security.NO_PERMISSION_REQUIRED)
def open_view(request):
    # ...

This will disable authorization for the view.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top