I have spent so much time to do it, just got quick way installing
pip install django-widget-tweaks
after install it we have to put it in settings
INSTALLED_APPS =[
'widget_tweaks',
]
and in html
{% load widget_tweaks %}
{% for r in register %}
<div class="form-group mb-2">
<label for="" class="form-label">{{r.label}}</label>
{{r|add_class:"form-control"}}
</div>
{% endfor %}
that's enough.
for more details about it https://pypi.org/project/django-widget-tweaks/
Top comments (0)