質問

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