R
R
Rassul Nassyrov2020-11-21 13:20:58
Django
Rassul Nassyrov, 2020-11-21 13:20:58

How to filter Django model in html template?

Something like this:

{% if User.objects.filter(username = us) %}
    ........
{% endif %}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-21
@bacon

You don’t need to do this, you already need to pass prepared data to the template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question