[Python] Working with user roles in Django

Discussão em 'Python' iniciado por Stack, Março 30, 2025.

  1. Stack

    Stack Membro Participativo

    I have some question In a project I have the need of work with users which are of three (may be more) types of them have different roles: physician patient administrator

    I have been thinking use of the Django Model Users and extend it creating a userprofile model ... But I ignore how to manage the different roles because, the userprofile model will have fields of the user model, althought I don't know how to address the roles topic.

    1 User have Many userprofiles may be? I don't know

    Or may be I will should create a Roles Model/Table in where I specify the roles types and create a relation with the Users Model. This is a good possibility.

    Another possibility (as a comment more below) is check the Django permissions system, in which I can create user groups, and assign permissions to these groups, althought here I can only edit, create and delete models really?

    I am a few confuse about of how to address this subject

    Searching I found this app. https://github.com/dabapps/django-user-roles

    If somebody can orient me about it, I will be much grateful Best Regards

    Continue reading...

Compartilhe esta Página