django-recaptcha-works / HELP

django-recaptcha-works Help
This file contains detailed information on how to configure and use

reCaptcha Service
In order to use this application you need a valid reCaptcha key pair, which
can be obtained for free from::

In your Django project’s settings module, add ``recaptcha_works`` to your
``INSTALLED_APPS`` setting::


The ``recaptcha_works`` application accepts the following configuration

  The public key as obtained from **

  The private key as obtained from **

  Boolean setting (``True``/``False``). Enables/disables secure communication
  with the recaptcha servers.

  A dictionary with the recaptcha customization options.
  Read the following page for more information:

  Boolean setting (``True``/``False``). By default, this is set to ``False``.
  When set to ``True``, the reCaptcha field validation is overridden. This
  setting is not meant to be enabled in production, but only for application
  testing. Also, note that this is a **global switch**, which, when enabled,
  overrides validation of the reCaptcha field on all reCaptcha-protected forms.
  To override the validation on a single form, set the ``required=False``
  attribute on the reCaptcha field on that specific form.

Example configuration for production::

        'theme': 'white',
        'lang': 'en',
        'tabindex': 0,

*django-recaptcha-works* provides a form field which can be attached to your
forms. Implementing a reCaptcha protected form is a *two step* process.

**Step 1**: Create the reCaptcha protected form::

    from django import forms
    from recaptcha_works.fields import RecaptchaField
    class RecaptchaProtectedForm(forms.Form):
        # ... other form fields
        recaptcha = RecaptchaField(label='Human test', required=True)

**Step 2**: Use the ``fix_recaptcha_remote_ip`` decorator around the view that
processes the form data. This is required because the remote IP is a mandatory
argument for the verification of the information the user has submitted in the
reCaptcha field, but it cannot be added to the form field automatically due to
limitations of the Django framework::

    from recaptcha_works.decorators import fix_recaptcha_remote_ip
    def view(request, *args, **kwargs):
        if request.method == 'POST':
            # ... process the form data here
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.