#VIEW def stats(request): obj = statistics.objects.filter(ig_username='user_number_one', action='FOLLOW').order_by('-id')[:1] template = loader.get_template('statistics.html') context = { 'obj':obj } #obj has 5 columns: id, ig_username, action, count_actions, date return HttpResponse(template.render(context, request)) #TEMPLATE {% if obj %} {% else %}

No stats are available.

{% endif %} how could I subtract datetime.datetime.now with statistics.date ?