I am trying to create a Online exam portal and I have created one admin portal for that site. I have 2 types of users in my site "Students" and "Teachers". How can I restrict students from accessing the admin portal and other views of admin panel?
Asked
Active
Viewed 89 times
1 Answers
0
In views.py in function related to your template, you can use the decorator permission_required as follows
from django.contrib.auth.decorators import permission_required
@permission_required('foo.access_my_view')
def my_view(request):
...
You have detailed instructions on how to add and modify the permissions here

Freshman's Dream
- 163
- 7