-1
我只想在用戶屬於某個羣組時顯示鏈接。如果用戶屬於某個羣組,則加載HTML
HTML:
{% if user.is_authenticated %}
{% users_in_group = Group.objects.get(name="boss").user_set.all() %}
{% if user in users_in_group %}
<li><a href='/register'>Create User</a></li>
{% endif %}
{% endif %}
非常感謝