from django.shortcuts import render from accounts.models import UserProfileInfo from django.contrib.auth.models import timezone # Create your views here. def resources(request): nb_members = UserProfileInfo.objects.filter(member=True, member_until__gt=timezone.now()).count() return render(request, 'resources/resources.html', {'nb_members':nb_members})