Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django login required as admin

from django.contrib.auth.decorators import user_passes_test

@user_passes_test(lambda u: u.is_superuser)
def my_view(request):
    ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #login #required #admin
ADD COMMENT
Topic
Name
6+2 =