jordij / django-sweetcaptcha

A simple Django sweetcaptcha field/form app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMPORTANT MALWARE ISSUE: https://blog.sucuri.net/2015/06/sweetcaptcha-service-used-to-distribute-adware.html

Django SweetCaptcha

Django SweetCaptcha form field/widget integration app.

django-sweetcaptcha provides a form field to integrate the sweetCaptcha service.

Installation

  1. Install or add django-sweetcaptcha to your Python path.
  2. Add sweetcaptcha to your INSTALLED_APPS setting.
  3. Register your sweetCaptcha account here.
  4. Add SWEETCAPTCHA_APP_ID and SWEETCAPTCHA_APP_KEY settings to the project's settings.py file. These settings are provided by the previous step.

Usage

Field

The quickest way to add sweetcaptcha to a form is to use the included SweetCaptchaField field type. A SweetCaptcha widget will be rendered with the field validating itself without any further action required from you. For example:

from django import forms
from sweetcaptcha.fields import SweetCaptchaField

class FormWithCaptcha(forms.Form):
    sweetcaptcha = SweetCaptchaField()

To allow for runtime specification of keys:

sweetcaptcha = SweetCaptchaField(
    app_id='your_app_id_here',
    app_key='your_key_here'
)

If specified these parameters will be used instead the ones specified in your project settings.

Credits

client.py taken from sweetcaptcha by Jaime Wyant .

Thanks to sweetcaptcha

About

A simple Django sweetcaptcha field/form app.


Languages

Language:Python 100.0%