Display join date and last_login in Django

def admin_home(request):
    data = Profile.objects.filter(Q(user__is_superuser=False), Q(
        user__is_staff=False), Q(user__last_login__isnull=False)).order_by('-user__last_login')[:10]
    context = {
        'data': data,
    }
    return render(request, "instructor/admin_home.html", context)

Code Example Quizzes

Related Code Examples