diff --git a/cof/settings/common.py b/cof/settings/common.py index f53a46b8..02c796ad 100644 --- a/cof/settings/common.py +++ b/cof/settings/common.py @@ -42,9 +42,6 @@ REDIS_DB = import_secret("REDIS_DB") REDIS_HOST = import_secret("REDIS_HOST") REDIS_PORT = import_secret("REDIS_PORT") -RECAPTCHA_PUBLIC_KEY = import_secret("RECAPTCHA_PUBLIC_KEY") -RECAPTCHA_PRIVATE_KEY = import_secret("RECAPTCHA_PRIVATE_KEY") - KFETOPEN_TOKEN = import_secret("KFETOPEN_TOKEN") LDAP_SERVER_URL = import_secret("LDAP_SERVER_URL") @@ -207,6 +204,14 @@ AUTHENTICATION_BACKENDS = ( 'kfet.auth.backends.GenericBackend', ) + +# reCAPTCHA settings +# https://github.com/praekelt/django-recaptcha +# +# Default settings authorize reCAPTCHA usage for local developement. +# Public and private keys are appended in the 'prod' module settings. + +NOCAPTCHA = True RECAPTCHA_USE_SSL = True CORS_ORIGIN_WHITELIST = ( diff --git a/cof/settings/prod.py b/cof/settings/prod.py index 2ffdf02f..fcdb3fdb 100644 --- a/cof/settings/prod.py +++ b/cof/settings/prod.py @@ -6,7 +6,7 @@ The settings that are not listed here are imported from .common import os from .common import * # NOQA -from .common import BASE_DIR +from .common import BASE_DIR, import_secret DEBUG = False @@ -28,3 +28,7 @@ STATIC_ROOT = os.path.join( STATIC_URL = "/gestion/static/" MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media") MEDIA_URL = "/gestion/media/" + + +RECAPTCHA_PUBLIC_KEY = import_secret("RECAPTCHA_PUBLIC_KEY") +RECAPTCHA_PRIVATE_KEY = import_secret("RECAPTCHA_PRIVATE_KEY") diff --git a/gestioncof/templates/demande-petit-cours-raw.html b/gestioncof/templates/demande-petit-cours-raw.html index f9bafd8e..a218a0e0 100644 --- a/gestioncof/templates/demande-petit-cours-raw.html +++ b/gestioncof/templates/demande-petit-cours-raw.html @@ -7,7 +7,7 @@ {% if success %}
Votre demande a été enregistrée avec succès !
{% else %} -