Check permission inside a template in Django

前端 未结 4 1408
甜味超标
甜味超标 2020-12-01 08:46

Can I use the Auth application\'s permission checking inside a template in Django? (I want to display a simple form at the end of the template for privileged users)

4条回答
  •  时光说笑
    2020-12-01 09:30

    sorry to 'unearth' this post but I have a problem related to permissions see my post: Django: logic not well applied in template using permissions (perm

    as Arindam seams to be very confortable with this concept I hope he or other could help me

    perms are not apply even if value are correct when I look for {{ perms }} in my template it return an object but not the list of permissions if I look for {{ perms.randomization.can_randomize }} it return False (or True) that is the good value my app is named randomization and I define can_randomize permission in Randomisation models (using meta) that is part of my randomization app

    I check settings.py but all seams to be ok

提交回复
热议问题