Skip to content

Commit 3723f93

Browse files
committed
no regional censure please.
1 parent 299a9b2 commit 3723f93

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ RECAPTCHA_PRIVATE_KEY = 'your private key'
3232
RECAPTCHA_PUBLIC_KEY = 'your public key'
3333
RECAPTCHA_DEFAULT_ACTION = 'generic'
3434
RECAPTCHA_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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
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>

snowpenguin/django/recaptcha3/templatetags/recaptcha3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ def recaptcha_key():
1111

1212
@register.inclusion_tag('snowpenguin/recaptcha/recaptcha_init.html')
1313
def 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')

0 commit comments

Comments
 (0)