Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django login required class based views

class MyView(...):
    # this is a generic view
    ...

my_view = login_required(MyView.as_view())

#and using my_view in your URLconf?
#Like so Myview = login_required(MyView.as_view(), login_url='login_url')
Source by code.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #django #login #required #class #based #views
ADD COMMENT
Topic
Name
8+8 =