From 0d82108e9758efbf00eaf19ffbb5087bfb95dbbb Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Thu, 10 Dec 2020 00:03:19 +0100 Subject: [PATCH] Up captcha --- .../settings/bootstrap3_theme_captcha.py | 21 ++++++++----------- .../settings/bootstrap3_theme_recaptcha.py | 2 +- .../security/recaptcha/README.rst | 3 +++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/simple/settings/bootstrap3_theme_captcha.py b/examples/simple/settings/bootstrap3_theme_captcha.py index 22dc67a7..f0a64996 100644 --- a/examples/simple/settings/bootstrap3_theme_captcha.py +++ b/examples/simple/settings/bootstrap3_theme_captcha.py @@ -2,21 +2,18 @@ from .base import * INSTALLED_APPS = list(INSTALLED_APPS) -try: - if 'captcha' not in INSTALLED_APPS: - INSTALLED_APPS.append('captcha') +if 'captcha' not in INSTALLED_APPS: + INSTALLED_APPS.append('captcha') - if 'fobi.contrib.plugins.form_elements.security.captcha' \ - not in INSTALLED_APPS: - INSTALLED_APPS.append( - 'fobi.contrib.plugins.form_elements.security.captcha' - ) - CAPTCHA_TEXT_FIELD_TEMPLATE = 'bootstrap3/captcha/text_field.html' +if 'fobi.contrib.plugins.form_elements.security.captcha' \ + not in INSTALLED_APPS: + INSTALLED_APPS.append( + 'fobi.contrib.plugins.form_elements.security.captcha' + ) - ENABLE_CAPTCHA = True +CAPTCHA_TEXT_FIELD_TEMPLATE = 'bootstrap3/captcha/text_field.html' -except Exception as e: - pass +ENABLE_CAPTCHA = True # FOBI_DEFAULT_THEME = 'simple' diff --git a/examples/simple/settings/bootstrap3_theme_recaptcha.py b/examples/simple/settings/bootstrap3_theme_recaptcha.py index a5d78112..bf7d7c0c 100644 --- a/examples/simple/settings/bootstrap3_theme_recaptcha.py +++ b/examples/simple/settings/bootstrap3_theme_recaptcha.py @@ -12,7 +12,7 @@ if not 'fobi.contrib.plugins.form_elements.security.recaptcha' \ ) # Test keys are taken from official dedicated Google page -# https://developers.google.com/recaptcha/docs/faq +# https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do RECAPTCHA_PUBLIC_KEY = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' RECAPTCHA_PRIVATE_KEY = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe' RECAPTCHA_USE_SSL = True diff --git a/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst b/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst index 8fc92cf1..9ac6bb9f 100644 --- a/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst +++ b/src/fobi/contrib/plugins/form_elements/security/recaptcha/README.rst @@ -47,6 +47,9 @@ Install `fobi` ReCAPTCHA plugin - ``RECAPTCHA_PUBLIC_KEY`` - ``RECAPTCHA_PRIVATE_KEY`` +For testing purposes obtain the keys `here +`_: + Troubleshooting and usage limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In combination with other captcha solutions