Python rest_framework.permissions 模块,DjangoModelPermissions() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用rest_framework.permissions.DjangoModelPermissions()

项目:djangorestframework-extras    作者:praekelt    | 项目源码 | 文件源码
def get_settings():
    """Due to app loading issues during startup provide a function to return
    settings only when needed."""

    # Import late because apps may not be loaded yet
    from rest_framework.authentication import SessionAuthentication, BasicAuthentication

    return getattr(settings, "REST_FRAMEWORK_EXTRAS", {
        "blacklist": {
            "sessions-session": {},
            "admin-logentry": {},
        },
        "authentication-classes": (SessionAuthentication, BasicAuthentication),
        "permission-classes": (DjangoModelPermissions,)
    })