queryset in django is empty condition code example
Example 1: django empty queryset
Model.objects.none()
Example 2: check if queryset is empty django template
<ul>
{% for athlete in athlete_list %}
<li>{{ athlete.name }}</li>
{% empty %}
<li>Sorry, no athletes in this list.</li>
{% endfor %}
</ul>