Answers for "check auth user django"

0

check auth user django

from django.conf import settings
from django.shortcuts import redirect

def my_view(request):
    if not request.user.is_authenticated:
        return redirect('%s?next=%s' % (settings.LOGIN_URL, request.path))
    # ...
Posted by: Guest on February-21-2022

Python Answers by Framework

Browse Popular Code Answers by Language