I have a view that calculates some quick statistics:

def index(request):
    context = {
        'topics_unanswered': Topic.on_site.filter(topic_type=1, 
date_published__isnull=False, reply__isnull=True).count(),
        'members_unapproved': 
User.objects.filter(profile__is_approved=False).count(),
        'members_unverified_7days': 
User.objects.filter(profile__is_approved=False, 
date_joined__lte=timezone.now()-timezone.timedelta(days=7), 
profile__email_verified=False).count(),
        'topics_today': 
Topic.on_site.filter(date_published__gte=timezone.now().date()).count(),
        'replies_today': 
Reply.on_site.filter(date_published__gte=timezone.now().date()).count(),
        'members_today': 
User.objects.filter(date_joined__gte=timezone.now().date()).count(),
    }
    return render(request, 'admincp/index.html', context)


But when I open the page I get the following warnings:

...\lib\site-packages\django\db\models\fields\__init__.
py:1393: RuntimeWarning: DateTimeField Topic.date_published received a 
naive dat
etime (2016-06-09 00:00:00) while time zone support is active.
  RuntimeWarning)

...\lib\site-packages\django\db\models\fields\__init__.
py:1393: RuntimeWarning: DateTimeField Reply.date_published received a 
naive dat
etime (2016-06-09 00:00:00) while time zone support is active.
  RuntimeWarning)

...\lib\site-packages\django\db\models\fields\__init__.
py:1393: RuntimeWarning: DateTimeField User.date_joined received a naive 
datetim
e (2016-06-09 00:00:00) while time zone support is active.
  RuntimeWarning)

[09/Jun/2016 13:38:09] "GET /admincp/ HTTP/1.1" 200 14002

I'm using timezone(), so why am I getting these warnings?

Thanks for the help!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67c3251d-1785-4393-a905-1a787a2476d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to