Skip to content

Commit

Permalink
Merge pull request #26 from Xyene/recaptcha-proxy
Browse files Browse the repository at this point in the history
Add settings option for reCAPTCHA proxies
  • Loading branch information
kbytesys authored Jan 19, 2019
2 parents a7fceed + 055aeca commit 7c0da6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ And add your reCaptcha private and public key to your django settings.py:
```python
RECAPTCHA_PRIVATE_KEY = 'your private key'
RECAPTCHA_PUBLIC_KEY = 'your public key'
# If you require reCaptcha to be loaded from somewhere other than https://google.com
# (e.g. to bypass firewall restrictions), you can specify what proxy to use.
# RECAPTCHA_PROXY_HOST = 'https://recaptcha.net'
```

If you have to create the apikey for the domains managed by your django project, you can visit this <a href="https://www.google.com/recaptcha/admin">website</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script src="https://www.google.com/recaptcha/api.js{% if explicit %}?onload=djangoRecaptchaOnLoadCallback&render=explicit{% if language %}&hl={{ language }}{% endif %}{% elif language %}?hl={{ language }}{% endif %}" async defer></script>
<script src="{{ recaptcha_host }}/recaptcha/api.js{% if explicit %}?onload=djangoRecaptchaOnLoadCallback&render=explicit{% if language %}&hl={{ language }}{% endif %}{% elif language %}?hl={{ language }}{% endif %}" async defer></script>
1 change: 1 addition & 0 deletions snowpenguin/django/recaptcha2/templatetags/recaptcha2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def recaptcha_invisible_button(public_key=None, submit_label=None, extra_css_cla
return {
'generated_id': generated_id,
'public_key': public_key or settings.RECAPTCHA_PUBLIC_KEY,
'recaptcha_host': getattr(settings, 'RECAPTCHA_PROXY_HOST', 'https://google.com'),
'form_id': form_id,
'submit_label': submit_label or _('Submit'),
'extra_css_classes': extra_css_classes,
Expand Down

0 comments on commit 7c0da6f

Please sign in to comment.