Skip to main content
===============================
Django REST framework reCAPTCHA
===============================

.. image:: https://badge.fury.io/py/djangorestframework-recaptcha.svg
:target: https://badge.fury.io/py/djangorestframework-recaptcha

.. image:: https://travis-ci.org/Maximilien-R/django-rest-framework-recaptcha.svg?branch=master
:target: https://travis-ci.org/Maximilien-R/django-rest-framework-recaptcha

.. image:: https://coveralls.io/repos/github/Maximilien-R/django-rest-framework-recaptcha/badge.svg?branch=master
:target: https://coveralls.io/github/Maximilien-R/django-rest-framework-recaptcha?branch=master

.. image:: https://readthedocs.org/projects/django-rest-framework-recaptcha/badge/?version=latest
:target: https://django-rest-framework-recaptcha.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

Django REST framework reCAPTCHA provides you a serializer field to handle and
validate Google reCAPTCHA response.

Documentation
-------------

The full documentation is at https://django-rest-framework-recaptcha.readthedocs.io.

Requirements
------------

* Python: 2.7, 3.4, 3.5, 3.6, 3.7
* Django: 1.10, 1.11, 2.0, 2.1
* Django REST framework: 3.4, 3.5, 3.6, 3.7, 3.8, 3.9

Installation
------------

To install Django REST framework reCAPTCHA, run this command in your terminal:

.. code-block:: console

$ pip install djangorestframework-recaptcha

This is the preferred method to install Django REST framework reCAPTCHA, as it
will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/

Once the ``djangorestframework-recaptcha`` installed, add it to your
``INSTALLED_APPS``:

.. code-block:: python

INSTALLED_APPS = (
...
"rest_framework_recaptcha",
...
)

Next, register yourself and obtain your reCAPTCHA credentials at
https://www.google.com/recaptcha/admin.

Finally, copy/paste your Google reCAPTCHA secret key to the
``DRF_RECAPTCHA_SECRET_KEY`` setting:

.. code-block:: python

DRF_RECAPTCHA_SECRET_KEY = "<your_reCAPTCHA_secret_key>"

Usage
-----

To use Django REST framework reCAPTCHA within your project you'll need to
import and add the ``ReCaptchaField`` serializer field into the wanted
serializer. For example:

.. code-block:: python

from rest_framework import serializers
from rest_framework_recaptcha import ReCaptchaField


class MySerializer(serializers.Serializer):
recaptcha = ReCaptchaField()

History
=======

[Unreleased]
------------

0.2.0 (2018-12-21)
------------------

Added
~~~~~

* Django REST framework 3.9, Python 3.7 & Django 2.1.
* Set long description content type to reStructuredText.

0.1.0 (2018-07-02)
------------------

Added
~~~~~

* First release on PyPI.

Release files for djangorestframework-recaptcha 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangorestframework-recaptcha 0.2.0
File Size Uploaded
djangorestframework-recaptcha-0.2.0.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for djangorestframework-recaptcha 0.2.0
File Interpreter ABI Platform
djangorestframework_recaptcha-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 18.5 kB

Release files / djangorestframework-recaptcha-0.2.0.tar.gz

Download URL djangorestframework-recaptcha-0.2.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b0442bd9ca9a8f21737a57f1ea7e7bf1c872e725b2423fd34304a821bceec0ff
BLAKE2b-256 checksum
How to use checksums
47a4fdc91ffa1f66f984ed12dd4583f681d4353f022307ef8ca321b82a7a7c96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / djangorestframework_recaptcha-0.2.0-py2.py3-none-any.whl

Download URL djangorestframework_recaptcha-0.2.0-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9d5f0353bc6fa8f7d30b72000a08d1ef1f3ba1bf9162d596a70a02ee119b1d95
BLAKE2b-256 checksum
How to use checksums
a401e3611baf28e3ca1babda3134dd1fbfd7cb0c7f559f01f4ed770b154ebc62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page