Created
December 20, 2016 22:22
-
-
Save patrys/d65a5daceb7417d69b61ae10509ecf70 to your computer and use it in GitHub Desktop.
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.template.response import TemplateResponse | |
from django.utils.decorators import method_decorator | |
from django.views.generic import View | |
class MyClassBasedView(View): | |
@method_decorator(login_required) | |
def dispatch(self, *args, **kwargs): | |
return super().dispatch(*args, **kwargs) | |
def get(self, request): | |
return TemplateResponse(request, 'index.html') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment