Skip to content

quanttide/django-quanttide-iam

Repository files navigation

django-quanttide-idam

量潮身份与访问管理Django工具箱

Installation

Install the package with pip.

pip install django-quanttide-idam

Add django_quanttide_idam to your INSTALLED_APPS in Django settings.py.

# settings.py

INSTALLED_APPS = [
    ...,
    'rest_framework',
    ...,
    'django_quanttide_idam',
    ...
]

Usage

修改Auth用户模型

# settings.py

AUTH_USER_MODEL = 'django_quanttide_idam.AuthUser'

修改REST Framework的默认Auth和Permission类

# settings.py

REST_FRAMEWORK = {
    ...,
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'django_quanttide_idam.authentication.IDTokenAuthentication',
    ],
    ...,
    'DEFAULT_PERMISSION_CLASSES': [
        'django_quanttide_idam.permissions.IsAdminUserOrIsAuthenticatedReadOnly',
    ],
}

License

This package uses Apache 2.0 License

Changelog

CHANGELOG

About

量潮身份与访问管理Django工具箱

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages