You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is very tough to edit these fields in forms.py and custom_field.html rendering since forms.py CaptchaField(widget=CustomCaptchaTextInput) will generate input HTML tags for both id_captcha_0 and id_captcha_0 with the same exact attributes you include for self.fields['captcha'].widget.attrs['...'] and I cannot figure out how to edit them in forms.py separately.
This relates to the same code as in the HTML5 validation errors issue if you want to look at it there.
Also placing {{id}}, {{name}}, {{key}} inside of custom_field.html does not work.
Need a way to separately edit {{hidden_field}} and {{text_field}} in forms.py or override the templates using the old style rendering but that does not work anymore. Why not include old style rendering and current custom_field.html rendering at the same time?
Editing templates inside of this location also did not have an effect:
/home/user/.local/share/virtualenvs/project_name/lib/python3.7/site-packages/captcha/templates/captcha/
Not sure if it has to do with the folder being named 'captcha' which is exactly the same as django-recaptcha if using both of those apps at the same time. But I uninstalled django-recaptcha and did not see any improvement.
The text was updated successfully, but these errors were encountered:
9mido
changed the title
Unable to override {{hidden_field}} and {{text_field}} in my project templates & virtual environment folders
Unable to override {{hidden_field}} and {{text_field}} in my project templates, virtual environment folders, & custom_field.html
Jun 7, 2020
It is very tough to edit these fields in forms.py and custom_field.html rendering since forms.py CaptchaField(widget=CustomCaptchaTextInput) will generate input HTML tags for both id_captcha_0 and id_captcha_0 with the same exact attributes you include for self.fields['captcha'].widget.attrs['...'] and I cannot figure out how to edit them in forms.py separately.
This relates to the same code as in the HTML5 validation errors issue if you want to look at it there.
It would be nice to use https://pypi.org/project/django-widget-tweaks/ to customize them but even that does not work when placing these tags inside of custom_field.html.
Also placing {{id}}, {{name}}, {{key}} inside of custom_field.html does not work.
Need a way to separately edit {{hidden_field}} and {{text_field}} in forms.py or override the templates using the old style rendering but that does not work anymore. Why not include old style rendering and current custom_field.html rendering at the same time?
Tried overriding templates by putting the following files inside of my project_name/templates/captcha/ with no effect after changing the contents of the files:
https://github.com/mbi/django-simple-captcha/blob/master/captcha/templates/captcha/hidden_field.html
https://github.com/mbi/django-simple-captcha/blob/master/captcha/templates/captcha/field.html
https://github.com/mbi/django-simple-captcha/blob/master/captcha/templates/captcha/text_field.html
Editing templates inside of this location also did not have an effect:
/home/user/.local/share/virtualenvs/project_name/lib/python3.7/site-packages/captcha/templates/captcha/
Not sure if it has to do with the folder being named 'captcha' which is exactly the same as django-recaptcha if using both of those apps at the same time. But I uninstalled django-recaptcha and did not see any improvement.
The text was updated successfully, but these errors were encountered: