You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
285 B
9 lines
285 B
10 months ago
|
from django.contrib.auth.decorators import login_required
|
||
|
|
||
|
|
||
|
class LoginRequiredMixin(object):
|
||
|
@classmethod
|
||
|
def as_view(cls, **initkwargs):
|
||
|
# 调用父类的as_view()
|
||
|
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
|
||
|
return login_required(view)
|