In this video, I'll cover how to add Bootstrap classes to Django form fields so your forms don't look horrific. There are a couple of ways to do it.
The first way I talk about is by overriding __init__.
The second way is by changing the attributes after the field has been created.
The third and most common way is to just add a attrs dictionary to a widget.
If all this sounds confusing, just check out the video. I don't take credit for any of this knowledge; I'm just trying to make this knowledge more digestible for people that get more out of watching videos.
Helpful links:
https://stackoverflow.com/questions/4...
https://docs.djangoproject.com/en/2.2...
https://docs.djangoproject.com/en/2.2...
Смотрите видео How to Add HTML Classes to Django Form Fields онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Jarad Python 17 Май 2019. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 2,837 раз и оно понравилось 49 посетителям.