Skip to content Skip to sidebar Skip to footer

How Do I Change The Look Of My Model Fields On The Front-end Side?

Ideally I want to 'expand' my fields on the frontend. They have to be way longer just like when you make them from in the admin-panel. Currently they look like this: However I wan

Solution 1:

If you looking for fast way, just use crispy formshttp://django-crispy-forms.readthedocs.org/en/latest/install.html#installing-django-crispy-forms

pip install --upgrade django-crispy-forms

in settings.py: INSTALLED_APPS = ( ... 'crispy_forms', )

at the top of template: {% load crispy_forms_tags %} and render form like this {% form|crispy %} it use bootstrap form by default

If you want more options to render your form, you can read docs about crispy. Or just use native django forms, and render each field of this form, like {{ form.your_field }}

Post a Comment for "How Do I Change The Look Of My Model Fields On The Front-end Side?"