Skip to content

Instantly share code, notes, and snippets.

@ozten
Forked from tofumatt/thing.py
Created December 5, 2011 23:50
Show Gist options
  • Save ozten/1435969 to your computer and use it in GitHub Desktop.
Save ozten/1435969 to your computer and use it in GitHub Desktop.
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import (login_required as
auth_login_required)
def login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url='/'):
"""BrowserID sepcific login_required decorator.
Decorator for views that checks that the user is logged in, redirecting
to the log-in page if necessary.
"""
return auth_login_required(
function=function,
redirect_field_name=redirect_field_name,
login_url=login_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment