S
S
s_katala2018-05-17 12:43:29
Django
s_katala, 2018-05-17 12:43:29

How to wrap div for non logged in users?

You need to wrap the div block so that it is available only to users who are not authorized
{% if user.is_authenticated %} this is for authorized, but how to do the opposite?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasyl Vandych, 2018-05-17
@s_katala

is_anonymous

O
Oleg Zakharov, 2018-05-17
@blazenn12

{% if user.is_authenticated %}
    <div>Для авторизованных</div>
{% else %}
   <div>Для всех остальных</div>
{% endif %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question