跳转到主要内容

覆盖Django-registration以通过电子邮件登录

项目描述

https://badge.fury.io/py/django-registration-with-email.svg https://travis-ci.org/PetrDlouhy/django-registration-with-email.svg?branch=master https://codecov.io/gh/PetrDlouhy/django-registration-with-email/branch/master/graph/badge.svg

覆盖django-registration-redux以通过电子邮件登录。此软件包提供

  • 通过电子邮件或用户名登录

  • 登录和密码重置表单中各种情况的用户方便的消息

  • 即使对于没有密码的用户,也可以发送密码重置电子邮件

  • 包括钓鱼安全的next_url机制

安全注意事项:为了更好的用户体验,密码重置表单会告知用户如果电子邮件不存在于系统中。这降低了安全性,因为攻击者可以查询系统是否存在账户。通过在表单中使用验证码可以降低风险,但您仍应评估这对于您的系统是否足够安全。

文档

完整文档在https://django-registration-with-email.readthedocs.io

快速入门

安装Django注册电子邮件

pip install django-registration-redux
pip install django-registration-with-email

将其添加到您的INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'registration',
    'django_registration_with_email',
    'captcha',
    ...
)

添加Django注册电子邮件的URL模式

urlpatterns = [
    ...
    path('accounts/', include('django_registration_with_email.urls')),
    path('accounts/', include('registration.backends.default.urls')),
    ...
]

在您的用户模型中将电子邮件设置为unique=True

class User(TimeStampedModel, AbstractUser):
   email = models.EmailField(
     verbose_name='email address',
     max_length=254,
     blank=True,
     null=True,
     unique=True,
 )

功能

  • TODO

运行测试

代码真的工作吗?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

开发命令

pip install -r requirements_dev.txt
invoke -l

致谢

用于渲染此软件包的工具

历史

0.2.0 (2021-04-05)

  • 使用django-registration-redux

0.1.0 (2021-03-01)

  • 在PyPI上的首次发布。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪一个,请了解有关 安装包 的更多信息。

源分发

django-registration-with-email-0.3.1.tar.gz (19.0 kB 查看哈希值)

上传时间

由以下支持