Skip to main content

Will add an reCAPTCHA field to Django admin login page to provide a more secure page

Project description

Django4_reCAPTCHA_admin_login_page

Will add an reCAPTCHA field to Django Admin Login Page to provide a more secure page

========================================================================

Steps to fast deployment:

  1. Sign up for reCAPTCHA Google reCAPTCHA.

  2. Install using: pip3 install django4-recaptcha-admin-login

  3. Add 'django4_recaptcha_admin_login' and 'captcha' to your INSTALLED_APPS in settings.py


INSTALLED_APPS = [
    ...,
    'django4_recaptcha_admin_login',
    'captcha',
    ...
]

  1. Add the Google reCAPTCHA keys generated in step 1 to your Django production settings with RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY.

Example: in settings.py:

RECAPTCHA_PUBLIC_KEY = os.environ.get('RECAPTCHA_PUBLIC_KEY')
RECAPTCHA_PRIVATE_KEY = os.environ.get('RECAPTCHA_PRIVATE_KEY')

And in env.py:

os.environ.setdefault('RECAPTCHA_PUBLIC_KEY',
                      'your public key')
os.environ.setdefault('RECAPTCHA_PRIVATE_KEY',
                      'your private key')
  1. Edit project urls.py file and change the import of admin:

From:

from django.contrib import admin

To:

from django4_recaptcha_admin_login import admin

This is all.

This package is depending on django-recaptcha 3.0.0 package. For extended informations and suport for django-recaptcha please see: https://pypi.org/project/django-recaptcha/

This package was tested on Django==4.1.2 and Python 3.10.8

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

django4-recaptcha-admin-login-1.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

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