Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateDoesNotExist - hcaptcha_widget.html #7

Open
nikson07 opened this issue Dec 27, 2021 · 1 comment
Open

TemplateDoesNotExist - hcaptcha_widget.html #7

nikson07 opened this issue Dec 27, 2021 · 1 comment

Comments

@nikson07
Copy link

W'z up bro.
I tired to make a custom tag to inherit hcaptcha form.
But got an error.

Django tried loading these templates, in this order:

django.template.loaders.filesystem.Loader: C:\Users\nikita\Desktop\engine\venv\lib\site-packages\django\forms\templates\hcaptcha_widget.html (Source does not exist)

django.template.loaders.app_directories.Loader: C:\Users\nikita\Desktop\engine\venv\lib\site-packages\django\contrib\admin\templates\hcaptcha_widget.html (Source does not exist)

django.template.loaders.app_directories.Loader: C:\Users\nikita\Desktop\engine\venv\lib\site-packages\django\contrib\auth\templates\hcaptcha_widget.html (Source does not exist)

django.template.loaders.app_directories.Loader: C:\Users\nikita\Desktop\engine\engine\applications\core\templates\hcaptcha_widget.html (Source does not exist)

django.template.loaders.app_directories.Loader: C:\Users\nikita\Desktop\engine\venv\lib\site-packages\allauth\templates\hcaptcha_widget.html (Source does not exist)

...

Django tried to find this html widget, but it was already in template folder, but still can't see it.

@nikson07
Copy link
Author

I am using Allauth package, and it tried to nest a hcaptcha form with another form.

forms.py
class CaptchaForm(forms.Form):
    hcaptcha = hCaptchaField()
customtag.py
@register.simple_tag()
def get_hcaptcha_form():
    return CaptchaForm
In signup form html im using this <div>
<div class="h-captcha d-flex justify-content-center" data-sitekey="{{ site_key }}" style="margin-bottom: 15px"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant