Django自定义重置密码表单

2024-09-27 09:37:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我是django(django 1.7python 2.7)的初学者。

我正试图将no captcha recaptcha添加到我的django重置密码表单中。

我想用这个recaptcha djano plugin

我已经按照说明添加了必要的设置:

Installed django-recaptcha to the Python path.

Added captcha to the INSTALLED_APPS setting.

在my settings.py文件中添加了以下内容:

RECAPTCHA_PUBLIC_KEY = '76wtgdfsjhsydt7r5FFGFhgsdfytd656sad75fgh' # fake - for the purpose of this post.
RECAPTCHA_PRIVATE_KEY = '98dfg6df7g56df6gdfgdfg65JHJH656565GFGFGs' # fake - for the purpose of this post.
NOCAPTCHA = True

然后,说明建议在表单中添加验证码,如下所示:

from django import forms
from captcha.fields import ReCaptchaField

class FormWithCaptcha(forms.Form):
    captcha = ReCaptchaField()

如何访问内置的重置密码表单?作为一个初学者,我怀疑我必须定制内置的重置密码表单,但我如何做到这一点呢?我甚至不确定内置重置密码表单在哪里。一个如何自定义内置重置密码表单或推送教程的示例会很方便。

我搜过搜,但找不到合适的。


Tags: ofthetodjangokeyforrecaptchacaptcha

热门问题