Checking for permission in django template not working
django, python
Solution
Are you passing perms in your template? Are you setting perms.paid.can_view_film either explicitly in your view or via the admin interface? Is the user a part of a group that has the perms.paid.can_view_film permission?
Are you sure the app name is 'paid'? That's supposed to be the app name, not the model name.
Django Perms
Problem
I want to verify user permission in template. If a user has permission he/she will be able to access the template. After writing the below code and I granted the user permission, when I view the page it will fall on the `{% else %}` statement. showing that the user don't have permission. How can I go about this? ``` #CREATED A GROUP IN DJANGO ADMIN CALLED 'Premium' Class Paid(models.Model): #models here class Meta: permissions=( ("view_film","Can view film"), ) ``` view ``` def eyo(request): return render_to_response('eyo.html',context_instance=RequestContext(request)) ``` template ``` {% block content %} {% if perms.paid.can_view_film %} <form action='https://www.test.com/checkout' method='post'> <input name='submit' type='submit' value='Checkout' /> </form> {% else %} <p> yo broke! </p> {% endif %} ```