Open ghost opened 5 years ago
Just a question, why you want to use a proxy only for recaptcha requests?
You can always set the proxy when you run your Django app with environment vars:
$ export HTTP_PROXY="http://localhost:8000"
$ export HTTPS_PROXY="https://localhost:8443"
This is only an example of course!
@kbytesys thank you very much
in china , we can not access *.google.com , but www.recaptcha.net
You don't need a proxy, because you need to change the url used by frontend and backend only. For the frontend I've added a configuration key, but I think that it's useful to add this feature also for the server requests.
Reopened because I'm adding the proxy support also on the backend
Link to Google's documentation https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
Can I use reCAPTCHA globally? Yes, please use "www.recaptcha.net" in your code in circumstances when "www.google.com" is not accessible.
First, replace with
After that, apply the same to everywhere else that uses "www.google.com/recaptcha/" on your site.
Presumably for web hosting in CN the server side verification URL might need to be changed too?
If you require a proxy, add a RECAPTCHA_PROXY setting, for example:
RECAPTCHA_PROXY = 'http://127.0.0.1:8000'