kbytesys / django-recaptcha3

Django reCaptcha v3 field/widget
GNU Lesser General Public License v2.1
70 stars 41 forks source link

please support RECAPTCHA_PROXY #6

Open ghost opened 5 years ago

ghost commented 5 years ago

If you require a proxy, add a RECAPTCHA_PROXY setting, for example:

RECAPTCHA_PROXY = 'http://127.0.0.1:8000'

kbytesys commented 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!

ghost commented 5 years ago

@kbytesys thank you very much

in china , we can not access *.google.com , but www.recaptcha.net

kbytesys commented 5 years ago

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.

kbytesys commented 5 years ago

Reopened because I'm adding the proxy support also on the backend

shuckc commented 3 years ago

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?