In this video, we'll look at django-crispy-forms - a package for building out forms in your Django code that look better and are highly customizable.
We'll refactor a simple Django Form class to use django-crispy-forms, and will customize the form's widgets and appearance. We will also demonstrate how to add HTMX attributes to a form field within the Form class itself, rather than in the template.
Starter code can be found in the Github repository:
github.com/bugbytes-io/crispy...
▶️ Full Playlist:
• Django-crispy-forms & ...
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:58 Creating Django form
03:05 Refactoring with django-crispy-forms
04:50 Changing form field widgets
07:05 Adding crispy-forms FormHelper
10:11 Adding HTMX attributes to form field
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugbytes
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: www.bugbytes.io/posts/
👾 Github: github.com/bugbytes-io/crispy...
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
django-crispy-forms: django-crispy-forms.readthedo...
#django #python
Негізгі бет Building Django forms with django-crispy-forms
Пікірлер: 61