본문 바로가기
프로그래밍(Programming)/장고(Django)

[Django] 템플릿 언어로 유저, 관리자로 필터링하는 방법 | How to filtering as User & Administrator from template language

by 갈팡이지팡이 2019. 10. 1.

In your_html_file.html

{% if user.is_authenticated %}

    <p>user login success</p>

    {% if user.is_superuser %}

        <p>and i' m superuser</p>

    {% endif %}

{% endif %}