springload / wagtail-django-recaptcha

A simple recaptcha field for Wagtail Form Pages
https://pypi.python.org/pypi/wagtail-django-recaptcha/
MIT License
56 stars 20 forks source link

TemplateDoesNotExist error (captcha/widget.html) #27

Open KalobTaulien opened 5 years ago

KalobTaulien commented 5 years ago

My site is Running Django 2.1 and Wagtail 2.4 and I get a TemplateDoesNotExist error and it's trying to load captcha/widget.html.

What I found was if you add captcha to your settings file (along with wagtailcaptcha) it solves this problem.

It'd be great if you through this in your main README.md file to help any newcomers get this up and running faster. #

DanielSwain commented 5 years ago

@KalobTaulien Thanks for your comment. I had the same problem and adding captcha to INSTALLED_APPS fixed it for me too. However, even though I've created a reCAPTCHA v2 key set, I am getting the "reCAPTCHA V1 IS SHUTDOWN message". Would you happen to know how to solve this problem?

KalobTaulien commented 5 years ago

Hey @DanAtShenTech

I managed to fix this by setting NOCAPTCHA = True. My captcha still displays, but it displays the right one now (click** (LOL typo) instead of text deciphering).

It also good Google a while to allow localhost from some reason. 🤔

DanielSwain commented 5 years ago

Thanks @KalobTaulien. That solved the problem. I now have the click interface. Also, I don't quite understand the second paragraph of your comment above.

KalobTaulien commented 5 years ago

@DanAtShenTech edited. Was a typo, my bad.

For the recpatcha settings I've had to wait ~45 minutes for Google to update to allow localhost urls with recaptcha. The site worked on staging and prod and later they must have updated their records because localhost worked later. This caused quite the headache. It has nothing to do with this repo, but for local development when you add localhost to allowed domains you might need to wait a while for the changes to propagate before continuing work.

This has happened a few times in a row now (for me at least)

DanielSwain commented 5 years ago

Thanks for the clarification @KalobTaulien. One thing that I do for local development which might be useful to you - I'm on Windows and I set up local development domains in my hosts folder. I started this to have my password manager automatically fill in forms, but it's also useful if I'm testing for hostname. I just prefix the domain name with "dev.":

From my hosts file:

# Map all dev domains to localhost (used mostly for having passwords filled in for specific domains when prompted by LP)
127.0.0.1  dev.somedomainname.com
wimfeijen commented 4 years ago

setting NOCAPTCHA = True did not help for me. Adding captcha to INSTALLED_APPS however, did work out! Thanks for the explanation KalobTaulien!

Pithikos commented 7 months ago

For newer versions, add django_recaptcha instead of captcha

Esosek commented 2 months ago

For newer versions, add django_recaptcha instead of captcha

Thank you so much, I was trying to make this work for hours using the captcha module and this solved it.