Why is Django calling my datetimes naive when they are not?
Question: I've got a blog system I'm building in Django 1.6, and I'm trying to render a
YearArchiveView, or at least get a list of years with posts, from my Post
model's DateTimeField, pub_date. It keeps telling me my pub_date is naive, but
I've explicitly changed them not to be.

Here's some puttering I've done on the python shell:

    
    
        >>> for post in posts:
    ...  post.pub_date
    ... 
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    datetime.datetime(2014, 1, 14, 3, 23, 2, tzinfo=<UTC>)
    >>> years = Post.live.datetimes('pub_date', 'year', order='DESC')
    /Users/.../django/db/models/fields/__init__.py:903: RuntimeWarning: DateTimeField Post.pub_date received a naive datetime (2014-01-13 21:40:01.051109) while time zone support is active.
      RuntimeWarning)
    
    >>> years
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/Users/.../django/db/models/query.py", line 71, in __repr__
        data = list(self[:REPR_OUTPUT_SIZE + 1])
      File "/Users/.../db/models/query.py", line 96, in __iter__
        self._fetch_all()
      File "/Users/.../django/db/models/query.py", line 854, in _fetch_all
        self._result_cache = list(self.iterator())
      File "/Users/.../django/db/models/sql/compiler.py", line 1107, in results_iter
        raise ValueError("Database returned an invalid value "
    ValueError: Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed?
    >>> import pytz
    >>> posts[0].posted
    datetime.datetime(2013, 9, 26, 0, 48, 8, tzinfo=<UTC>)
    >>> 
    

What the hell is going on? I'm going crazy!


Answer: Check that `USE_TZ` is true. See the
[docs](https://docs.djangoproject.com/en/dev/releases/1.6/#queryset-dates-
returns-date-objects) on Django 1.6 changes to queryset.dates

