I am working on a Django application that will have two types of users: admins and users. Both are groups in my project, and depending on which group a separate login belongs to, I would like to redirect them to separate pages. Now I have it in my .py settings
LOGIN_REDIRECT_URL = 'admin_list'
This redirects all users who are members of the "admin_list", but the view is accessible only to members of the Admins group, otherwise the value 403 is returned. As for the login itself, I just use the one Django provides. I added this to my main urls.py file to use these views:
url(r'^accounts/', include('django.contrib.auth.urls')),
How can I do this so that only members of the Admins group are redirected to this view, and everyone else is redirected to another view?
python django django-admin django-views
Chris clouten
source share