django-crispy-forms: Upgrading from 1.6.1 to 1.7.* - forms don't work
- Package version: 1.7.2 (or 1.7.0 or 1.7.1)
- Django version: 1.11.16
- Python version: 3.5.2
- Template pack: (Optional)
Description:
-
We upgraded Speedy Net from
django-crispy-forms==1.6.1todjango-crispy-forms==1.7.2 -
We didn’t expect anything to change.
-
Our contact form stopped working in all 4 websites.
Preferably also include:
- Example Django Crispy Forms code
The tag is {% crispy form %} on feedback_form.html
-
Screenshots
-
With
django-crispy-forms==1.6.1:
-
With
django-crispy-forms==1.7.2:

- Actual HTML generated
There is no <textarea ... in the HTML with 1.7.0 up to 1.7.2.
- Expected HTML
There is <textarea ... in the HTML with 1.6.1.
I can’t paste HTML into this issue, I tried.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 39
Commits related to this issue
- Downgrading to django-crispy-forms==1.6.1 in requirements. https://github.com/django-crispy-forms/django-crispy-forms/issues/848 — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
- Downgrading to django-crispy-forms==1.6.1 in requirements. https://github.com/django-crispy-forms/django-crispy-forms/issues/848 — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
- Downgrading to django-crispy-forms==1.6.1 in requirements. https://github.com/django-crispy-forms/django-crispy-forms/issues/848 — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
- Run only speedy.core.feedback tests - for testing. https://github.com/django-crispy-forms/django-crispy-forms/issues/848 — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
- Run only speedy.core.feedback tests - for testing. https://github.com/django-crispy-forms/django-crispy-forms/issues/848 — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
- - Upgraded django-crispy-forms to 1.7.2. - Instead of using FormHelper() directly, use FormHelperWithDefaults() where render_unmentioned_fields = True. [https://github.com/django-crispy-forms/django-... — committed to speedy-net/speedy-net by uri-rodberg 5 years ago
I would like to reopen this issue. It’s very easy to reproduce for me.
Let’s have a ModelForm and add a few custom fields to it
If you render this form in Crispy Forms < 1.7.0 it works and renders both fields If you render this form in Crispy Forms >= 1.7.0 it renders field1 only
The reason is commit https://github.com/django-crispy-forms/django-crispy-forms/commit/6b93e8a362422db8fe54aa731319c7cbc39990ba which broke it. The ‘extra_field’ is neither required or hidden so it depends on render_unmentioned_fields which defaults to False. Since the field is mentioned in Meta.fields, it should be rendered. See also docs/form_helper.rst
I wonder why @ghinch committed this at all. If fields are mentioned in Meta.fields they should be unconditionally rendered, shouldn’t they?
and if I imported :
from crispy_forms.helper import FormHelperin the forms.py it will yield another error :
it gives me error in th cmd :
I’ve just instaleed it today, by pip install --upgrade django-crispy-forms i belive it is 1.7.2
I having the same issue , and I asked it on https://stackoverflow.com/questions/54101476/crispy-forms-and-bootstrap-styles?noredirect=1#comment95058861_54101476 and I hope any one could help me with it