reCAPTCHA field for Django REST framework serializers.
Project description
===============================
Django REST framework reCAPTCHA
===============================
.. image:: https://badge.fury.io/py/django-rest-framework-recaptcha.svg
:target: https://badge.fury.io/py/django-rest-framework-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
* Django: 1.10, 1.11, 2.0
* Django REST framework: 3.4, 3.5, 3.6, 3.7, 3.8
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.1.0 (2018-07-02)
------------------
Added
~~~~~
* First release on PyPI.
Django REST framework reCAPTCHA
===============================
.. image:: https://badge.fury.io/py/django-rest-framework-recaptcha.svg
:target: https://badge.fury.io/py/django-rest-framework-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
* Django: 1.10, 1.11, 2.0
* Django REST framework: 3.4, 3.5, 3.6, 3.7, 3.8
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.1.0 (2018-07-02)
------------------
Added
~~~~~
* First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for djangorestframework-recaptcha-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f68ac876471a6adb05aeb45627e1e1c24a432aad4d485124094e6949e149fcb |
|
MD5 | 8afd4d0445f862534f3f247e6b9e601e |
|
BLAKE2b-256 | 512bbf5c24135195ba0e7f28beb29fa1b2412a7ab1e727376dad70ff859803de |
Close
Hashes for djangorestframework_recaptcha-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15060d604d4b7b8da6962d9ef56910eacd89fcc629dd29b3a932ebb9fde6b4c6 |
|
MD5 | b63f000c65207a99a895a39bab5b0102 |
|
BLAKE2b-256 | 71f01c830583c1a5c156ec60d065fef3c38223c3857dda748005d0d4c9fc751e |