# Views.py @csrf_exempt def stats(request): obj = statistics.objects.filter(username='user_n1', action='FOLLOW').order_by('-id')[:1] template = loader.get_template('statistics.html') context = { 'obj':obj } return HttpResponse(template.render(context, request)) # statistics.html file {% if obj %}
No stats are available.
{% endif %}