【发布时间】:2019-11-29 13:31:28
【问题描述】:
我正在使用 Django Rest Framework 开发应用程序。如何扩展对用户登录的身份验证检查?
例如,我需要检查登录用户的 is_active 和 created_at 属性,并根据它们的值允许或禁止登录,但前提是密码经过 Django 验证。
我了解 Django 和 Django Rest Framework 自定义身份验证。
https://docs.djangoproject.com/en/2.2/topics/auth/customizing/
https://www.django-rest-framework.org/api-guide/authentication/#custom-authentication
问题是,这需要我重新实现内置的身份验证检查。我想在此之上添加检查。
谢谢!
【问题讨论】:
标签: django authentication django-rest-framework