0
DTL problem. Please help
Hello everyone I want to check if my dictionary item 'status' is empty in my django template. The dictionary in the views.py goes like this: context= { "name": username, "email": usermail, "status": status, } return render(request, "myapp/dataview.html", context)
2 Answers
+ 1
{% if status %}
{# Your work #}
{% else %}
{# status was blank #}
{% endif %}
In Python, blank variables return "False"
+ 1
AKSHAYđźđł thanks