简体   繁体   中英

Django user groups login check

I created a group as a users for my django project. I want to create users with no admin permission. I just want them to be able to log-in website. I have a form, I want that only users can fill this form. So I want to check if they are logged in or not. Is it possible?

is_superuser and is_staff in User model are meant for this kind of stuff. Create your users with User.objects.create_user() method and they will be created with limited access and no admin privilege.

Also for checking privileges on pages, use decorators like login_required or mixin and permissions classes to control access to pages.

And for advance Authorization checking there are packages like django-guardian which are awesome but need more understanding of django.

By the way, your question is not good and I suggest add more details and a specific problem that we can help much better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM