Select between two dates with Django
If you are using a DateTimeField
, Filtering with dates won’t include items on the last day.
You need to casts the value as date:
...filter(created_at__date__range=(start_date, end_date))
Use the __range
operator:
...filter(current_issue__isnull=True, created_at__range=(start_date, end_date))
__range