title: Django: Filter data between to dates | DatetimeField received a naive datetime
body: <p>I <em>simply</em> want to filter my records between two dates.</p>
  <p>Let's say there is a record table <code>Measurements</code> that has the property <code>timestamp</code>:</p>
  <pre><code>class Measurements(models.Model):
      id = models.BigAutoField(primary_key=True)
      timestamp = models.DateTimeField()
  </code></pre>
  <p>When I checked the <code>timestamp</code> of the last record <code>Measurements.objects.last().timestamp</code> it returns:</p>
  <pre><code>datetime.datetime(2020, 10, 13, 6, 29, 48, 90138, tzinfo=&lt;UTC&gt;)
  </code></pre>
  <p>Now I want to filter the data between to dates <code>from_date</code> and <code>to_date</code>. According to previous questions about this issue, I used <code>make_aware</code>. For testing I used <code>count</code> to get the amount of entries.</p>
  <pre><code>from .models import *
  from datetime import datetime
  from django.utils.timezone import make_aware
  
  def get_measurements(request):
      from_date = make_aware(datetime(2020, 10, 12, 15, 30, 0, 0))
      to_date = make_aware(datetime(2020, 10, 12, 16, 0, 0, 0))
      print(from_date)
      print(to_date)
  
      measurements = DriveMeasurements.objects.filter(
          plc_timestamp__range=[&quot;2020-01-01&quot;, &quot;2020-01-31&quot;])
      print(measurements.count())
  </code></pre>
  <p>When printing the two dates in my shell, it returns:</p>
  <pre><code>datetime.datetime(2020, 10, 12, 15, 30, tzinfo=&lt;UTC&gt;)
  datetime.datetime(2020, 10, 12, 16, 0, tzinfo=&lt;UTC&gt;)
  </code></pre>
  <p>When I run the function above, Django fires the following message:</p>
  <p><strong>RuntimeWarning: DateTimeField Measurements.timestamp received a naive datetime (2020-01-31 00:00:00) while time zone support is active.
  warnings.warn(&quot;DateTimeField %s received a naive datetime (%s)&quot;</strong></p>
  <p>The print statement <code>print(measurements.count())</code> prints <code>0</code> but there are ~ 18000 records in the database.</p>
  <p>So why is the filter not working and the Django message thrown?</p>