Skip to content

A Django package that is essentially a fork of Vitor Freitas' simple-recaptcha repo. Contains a decorator for use with reCAPTCHA v2.

License

Notifications You must be signed in to change notification settings

armandtvz/django-simple-recaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-simple-recaptcha

A Django package that is essentially a fork of Vitor Freitas' simple-recaptcha repo (licensed under MIT License). Contains a decorator for use with reCAPTCHA v2. Thanks Vitor!

This package has no tests yet—and therefore, is not production-ready.

Also, reCAPTCHA v3 and invisible reCAPTCHA is not supported yet.

Quickstart

  1. Install the app using:
pip install git+https://github.com/armandtvz/django-simple-recaptcha.git
  1. Add "recaptcha" to your INSTALLED_APPS setting:
INSTALLED_APPS = [
    ...
    'recaptcha',
]
  1. Add the following to the MIDDLEWARE setting:
MIDDLEWARE = [
    '...',
    'recaptcha.middleware.ReCaptchaCredentialMiddleware',
]
  1. Add the following to your settings.py file (remember to always protect secret keys appropriately):
# These settings will only be used in production.
GOOGLE_RECAPTCHA_SITE_KEY = <recaptcha_site_key>
GOOGLE_RECAPTCHA_SECRET_KEY = <recaptcha_secret_key>
  1. Add the required JS to the template:
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
  1. Add the reCAPTCHA checkbox to the template:
<div class="g-recaptcha" data-sitekey="{{ request.recaptcha_site_key }}"></div>
<!-- Or use the checkbox template -->
{% include "recaptcha/checkbox.html" %}

License

This project is licensed under the GPL-3.0 public license. See LICENSE.

About

A Django package that is essentially a fork of Vitor Freitas' simple-recaptcha repo. Contains a decorator for use with reCAPTCHA v2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published