title: django 1.4 - can't compare offset-naive and offset-aware datetimes
body: <p>I am in the process of migrating an application from django 1.2 To 1.4.</p>
  
  <p>I have a daily task object which contains a time of day that task should be completed:</p>
  
  <pre><code>class DailyTask(models.Model):
      time = models.TimeField()
      last_completed = models.DateTimeField()
      name = models.CharField(max_length=100)
      description = models.CharField(max_length=1000)
      weekends = models.BooleanField()
  
      def __unicode__(self):
          return '%s' % (self.name)
  
      class Meta:
          db_table = u'dailytask'
          ordering = ['name']
  </code></pre>
  
  <p>In order to check if a task is still required to be completed today, I have the following code:</p>
  
  <pre><code>def getDueDailyTasks():
      dueDailyTasks=[]
      now = datetime.datetime.now()
      try:
          dailyTasks = DailyTask.objects.all()
      except dailyTask.DoesNotExist:
          return None
      for dailyTask in dailyTasks:
          timeDue = datetime.datetime(now.year,now.month,now.day,dailyTask.time.hour,dailyTask.time.minute,dailyTask.time.second)
          if timeDue&lt;now and timeDue&gt;dailyTask.last_completed:
              if dailyTask.weekends==False and now.weekday()&gt;4:
                  pass
              else:
                  dueDailyTasks.append({'id':dailyTask.id,
                              'due':timeDue,
                               'name': dailyTask.name,
                               'description':dailyTask.description})
      return dueDailyTasks
  </code></pre>
  
  <p>This worked fine under 1.2, But under 1.4 I get the error:</p>
  
  <pre><code>can't compare offset-naive and offset-aware datetimes
  </code></pre>
  
  <p>due to the line</p>
  
  <pre><code>if timeDue&lt;now and timeDue&gt;dailyTask.last_completed
  </code></pre>
  
  <p>and both comparison clauses throw this error.</p>
  
  <p>I have tried making timeDue timezone aware by adding pytz.UTC as an argument, but this still raises the same error.</p>
  
  <p>I've read some of the docs on timezones but am confused as to whether I just need to make timeDue timezone aware, or whether I need to make a fundamental change to my db and existing data.</p>