Django Tutorial: Building and Securing Web Applications

I am using auth0 with django and redirecting users to django amin site. In the process roles, I have added:
if details[‘role’]==‘user’:

    user.is_staff = True

    user.is_superuser = False

    user.is_active= True

    user.save()

if the user is a super user , the user gets all rights in the admin site. However, when I assign groups and permissions to a staff user, the staff user is not able to view anything on the admin site. It says,
You don’t have permission to view or edit anything.

Please let me know if I need to add any extra layer to get the django groups and permissions working?