Skip to main content

Django-110-hCaptcha provides a simple way to protect your django 1.10 forms using hCaptcha

Project description

A fork of django-hCaptcha by Andrej Zbín, Modified for Django 1.10 for hCaptcha support in legacy systems

Django-110-hCaptcha provides a simple way to protect your django 1.10 forms using hCaptcha.

Configuration

Add “django-hcaptcha” to your INSTALLED_APPS setting like this:

INSTALLED_APPS = [
    ...
    'hcaptcha',
]

For development purposes no further configuration is required. By default, django-hCaptcha will use dummy keys.

For production, you’ll need to obtain your hCaptcha site key and secret key and add them to you settings:

HCAPTCHA_SITEKEY = '<your sitekey>'
HCAPTCHA_SECRET = '<your secret key>'

You can also configure your hCaptcha widget globally (see all options):

HCAPTCHA_DEFAULT_CONFIG = {
    'onload': 'name_of_js_function',
    'render': 'explicit',
    'theme': 'dark',  # do not use data- prefix
    'size': 'compact',  # do not use data- prefix
    ...
}

If you need to, you can also override default hcaptcha endpoints:

HCAPTCHA_JS_API_URL = 'https://hcaptcha.com/1/api.js'
HCAPTCHA_VERIFY_URL = 'https://hcaptcha.com/siteverify'

Use proxies:

HCAPTCHA_PROXIES = {
   'http': 'http://127.0.0.1:8000',
}

Change default verification timeout:

HCAPTCHA_TIMEOUT = 5

Usage

Simply add hCaptchaField to your forms:

from hcaptcha.fields import hCaptchaField

class Forms(forms.Form):
    ....
    hcaptcha = hCaptchaField()
    ....

You can override default config by passing additional arguments:

class Forms(forms.Form):
    ....
    hcaptcha = hCaptchaField(theme='dark', size='compact')
    ....

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-110-hCaptcha-1.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

django_110_hCaptcha-1.0.5-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file django-110-hCaptcha-1.0.5.tar.gz.

File metadata

  • Download URL: django-110-hCaptcha-1.0.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for django-110-hCaptcha-1.0.5.tar.gz
Algorithm Hash digest
SHA256 60b7bfc521af3388083d141b0cf9b3bf4471063827d7b7e80903da966a13f499
MD5 bf01cac3b13626566a0be8c7d8cab901
BLAKE2b-256 0710216b414bce9127fb23508e2220f1a247a5eda63aa17c897eae3ca7f353f3

See more details on using hashes here.

File details

Details for the file django_110_hCaptcha-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: django_110_hCaptcha-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for django_110_hCaptcha-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 31e12ec02964204c8d3060939c46c67affdae2adcebec97ab4a872b6697b820e
MD5 137ee334dbe81f4613bec51513341ea0
BLAKE2b-256 293ee6e056a7fd1c265aeaf165f9a7d045dc7f15a4a3ceb577e2e3e2648de7dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page