Question

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?

Was it helpful?

Solution

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

This will disable authorization for the view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top