File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
snowpenguin/django/recaptcha3
templates/snowpenguin/recaptcha Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ RECAPTCHA_PRIVATE_KEY = 'your private key'
3232RECAPTCHA_PUBLIC_KEY = ' your public key'
3333RECAPTCHA_DEFAULT_ACTION = ' generic'
3434RECAPTCHA_SCORE_THRESHOLD = 0.5
35+ # If you require reCaptcha to be loaded from somewhere other than https://google.com
36+ # (e.g. to bypass firewall restrictions), you can specify what proxy to use.
37+ # RECAPTCHA_FRONTEND_PROXY_HOST = 'https://recaptcha.net'
3538
3639```
3740
Original file line number Diff line number Diff line change 1- < script src ='https://www.google.com /recaptcha/api.js?render={{ public_key }} '> </ script >
1+ < script src ='{{ google_api_host }} /recaptcha/api.js?render={{ public_key }} '> </ script >
Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ def recaptcha_key():
1111
1212@register .inclusion_tag ('snowpenguin/recaptcha/recaptcha_init.html' )
1313def recaptcha_init (public_key = None ):
14- return {'public_key' : public_key or settings .RECAPTCHA_PUBLIC_KEY }
14+
15+ return {
16+ 'public_key' : public_key or settings .RECAPTCHA_PUBLIC_KEY ,
17+ 'google_api_host' : 'https://www.google.com' if not hasattr (settings , 'RECAPTCHA_FRONTEND_PROXY_HOST' )
18+ else settings .RECAPTCHA_FRONTEND_PROXY_HOST
19+ }
1520
1621
1722@register .inclusion_tag ('snowpenguin/recaptcha/recaptcha_ready.html' )
You can’t perform that action at this time.
0 commit comments