Installation

Quick Installation

pip install drf-iam

Project Configuration

  1. Add drf_iam to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    'drf_iam',
]
  1. Add the Role relationship to your User model:

from django.contrib.auth.models import AbstractUser
from drf_iam.models import Role

class User(AbstractUser):
    role = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True)