Open montaro opened 7 years ago
Am experiencing this as well, also using django-bootstrap-form==3.2.1
, with Django==1.10.5
.
Hi, I was getting the same issue in my project using Python 3.4.3 and I figured out that the issue is in the field.html template at line 50. I had to add the check on form.required_css_class
into the if statement like the following <label class="control-label {{ classes.label }} {% if field.field.required and form.required_css_class %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
.
I just can't explain the reason for it.
The second problem is that this works without my change when running through python manage.py runserver
in local dev environment, but once I deploy my code and that I run it through nginx and uwsgi it throws the same error as described here.
Any idea on why it just doesn't show or output the empty variable like it does in local dev?
More information about this issue, from the documentation here: https://docs.djangoproject.com/en/1.11/ref/forms/api/#styling-required-or-erroneous-form-rows to fix this issue without modifying django-bootstrap-form we had to add the following line to our form. required_css_class = 'required'
. Hope it can help you fix your issue.
I always see this error in logs, I use: