Django get all users with last_login older than 360 days

I'm trying the below code ...

from datetime import datetime, timedelta
from django.utils import timezone

yearago = timezone.make_aware(datetime.today() - timedelta(days=366))
old_users = User.objects.filter(last_login__gt=yearago)
old_users.all

The output show users that have logged in this year, whereas I want users who's last login was over 366 days ago.

So what am I missing?

Back to Top