【问题标题】:How to leverage Django's authentication system in Next.js?如何在 Next.js 中利用 Django 的身份验证系统?
【发布时间】:2020-10-03 09:10:23
【问题描述】:

我正在开发一个 Web 应用程序,它的后端是用 Django 编写的(使用 Django REST Framework for API),前端是用 Next.js 编写的。

我正在考虑使用 PassportJS 或 Auth0 等工具在前端实现用户身份验证。 但是,有没有办法利用 Django 自己的身份验证系统并避免使用上述第三方库?

【问题讨论】:

标签: django authentication django-rest-framework next.js


【解决方案1】:

为什么不考虑在制作的 django UserCreationForm 中使用它,它看起来很简单

from django.contrib.auth.forms import UserCreationForm

以及来自

的用户
from django.contrib.auth.models import User

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-12
    相关资源
    最近更新 更多