Giving user access to specific models in admin

If I had a model like this:

class Dealer(models.Model):

    name        = models.CharField(max_length=10)
    other_name  = models.CharField(max_length=10,  blank=True, null=True)
... etc.

If I wanted to create a user who can log into the administrator’s site and only have access to edit this model, how can I do this?

I looked around and could not successfully get it to work. I also studied packages such as a guardian, but was not successful. What am I missing here?

Thank!

+4
source share
1 answer

, . , , . "Staff" (is_staff = 1), Dealer.

Admin permissions right for one user

, Dealer. Django.

Django :

  • "" "" .
  • , "" "" .
  • "" .

, . has_add_permission(), has_change_permission() has_delete_permission(), ModelAdmin, .

+6

Source: https://habr.com/ru/post/1542221/


All Articles