django nocaptcha recaptcha表单字段/小部件应用程序。
django-nocaptcha-recaptcha的Python项目详细描述
[![构建状态](https://travis-ci.org/imaginaryplances/django-nocaptcha-recaptcha.svg?branch=master)“(https://travis ci.org/imaginaryscapture/django nocaptcha recaptcha)
summary
只需在django表单中添加一个
norecaptchfield字段,即可向django表单添加新样式的google recaptcha小部件。
更新显著地改变了ReCaptcha的外观和功能这被称为
ReCaptcha 2或“nocaptcha ReCaptcha”
此模块旨在成为django recaptcha的后续模块,以支持新样式的Google recaptcha它借用了django recaptcha的很多逻辑,但是已经更新了
以支持google的更改。
对于此服务的谷歌文档,访问以下站点:
不带JavaScript的浏览器
-很容易通过FormField添加到表单
-类似于django recaptcha
-工作演示项目
-适用于Python 2.7和3.4
将以下内容添加到设置中。py
所需设置:
NORECAPTCHA_SITE_KEY(string)=谷歌提供的SITE_KEY
NORECAPTCHA_SECRET_KEY(string)=谷歌提供的SECRET_KEY
可选设置:
NORECAPTCHA_VERIFY_URL(string)=重新捕获api端点以进行验证。
最好将其保留为默认设置。
默认设置为https://www.google.com/recaptcha/api/sitevirify
norecaptcha_widget_template(string)=小部件模板的位置。
默认值是nocaptcha_recaptcha/widget.html
将字段添加到要保护的窗体中。
from nocaptcha_recaptcha.field s import norecaptchfield
class demoform(forms.form):
…
captcha=norecaptchfield()
模板或其他地方,因此它在包含django表单的页面上可用。
<;script src=“https://www.google.com/recaptcha/api.js”async defer>;
(可选)
您可以自定义该字段。
-您可以通过以下
-您可以覆盖小部件的模板,就像覆盖任何其他django模板一样
要使用它,请运行以下命令:
cd demo
export norecaptcha_site_key=“<;your site key>;”
export norecaptcha_secret_key=“<;your secret key>;”
./manage.py runserver
在浏览器中,访问http://localhost:8000
testing
python setup.python test
summary
只需在django表单中添加一个
norecaptchfield字段,即可向django表单添加新样式的google recaptcha小部件。
更新显著地改变了ReCaptcha的外观和功能这被称为
ReCaptcha 2或“nocaptcha ReCaptcha”
此模块旨在成为django recaptcha的后续模块,以支持新样式的Google recaptcha它借用了django recaptcha的很多逻辑,但是已经更新了
以支持google的更改。
对于此服务的谷歌文档,访问以下站点:
不带JavaScript的浏览器
-很容易通过FormField添加到表单
-类似于django recaptcha
-工作演示项目
-适用于Python 2.7和3.4
将以下内容添加到设置中。py
所需设置:
NORECAPTCHA_SITE_KEY(string)=谷歌提供的SITE_KEY
NORECAPTCHA_SECRET_KEY(string)=谷歌提供的SECRET_KEY
可选设置:
NORECAPTCHA_VERIFY_URL(string)=重新捕获api端点以进行验证。
最好将其保留为默认设置。
默认设置为https://www.google.com/recaptcha/api/sitevirify
norecaptcha_widget_template(string)=小部件模板的位置。
默认值是nocaptcha_recaptcha/widget.html
将字段添加到要保护的窗体中。
from nocaptcha_recaptcha.field s import norecaptchfield
class demoform(forms.form):
…
captcha=norecaptchfield()
模板或其他地方,因此它在包含django表单的页面上可用。
<;script src=“https://www.google.com/recaptcha/api.js”async defer>;
(可选)
您可以自定义该字段。
-您可以通过以下
-您可以覆盖小部件的模板,就像覆盖任何其他django模板一样
要使用它,请运行以下命令:
cd demo
export norecaptcha_site_key=“<;your site key>;”
export norecaptcha_secret_key=“<;your secret key>;”
./manage.py runserver
在浏览器中,访问http://localhost:8000
testing
python setup.python test