Frage

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?

War es hilfreich?

Lösung

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

This will disable authorization for the view.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top