Created
October 13, 2012 19:07
-
-
Save elyezer/3885790 to your computer and use it in GitHub Desktop.
LoginRequiredMixin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.decorators import login_required | |
from django.utils.decorators import method_decorator | |
from django.views.generic.base import View | |
class LoginRequiredMixin(View): | |
@method_decorator(login_required) | |
def dispatch(self, *args, **kwargs): | |
return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment