Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

user passes test django

from django.contrib.auth.decorators import user_passes_test

def email_check(user):
    return user.email.endswith('@example.com')

@user_passes_test(email_check)
def my_view(request):
    ...
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #user #passes #test #django
ADD COMMENT
Topic
Name
5+2 =