Django django-widget

179 views Asked by At

I'm new in Django and I'm trying to use 'widget_tweaks' library for add a placeholder tag in my fields. I have this working with no problem:

{{ field|append_attr:"class:form-control"|append_attr:"placeholder:any placeholder"  }}

But now I need to replace "any placeholder" in the above line with field.label, how can I scape the value to use field.label properly?

1

There are 1 answers

0
Tareq On

You should have INSTALLED_APPS defined in your settings.py. Add "widget_tweaks" to that.

See the django doc on Settings/INSTALLED_APPS: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps