In this video, we'll demonstrate how to integrate django-taggit with Django REST Framework in order to serialize our tagged models to JSON.
We will then dive into an example of filtering our list of items based on a chosen tag, using Alpine.js to control which tags are shown on the page. We show a variety of Alpine directives - x-data, x-init, x-for, x-on and x-bind (note the last two use their shorthand syntax)
☕️ ???????????? ???????? ???? ????????????????????????:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
???? ????????????????????????????????:
00:00 Intro
00:52 Adding Django REST Framework
01:19 Creating ModelSerializer
03:49 Creating ListAPIView
06:28 Creating an Alpine component with x-data directive
08:56 Fetching JSON with x-init directive
12:33 Adding button for all films
14:37 Binding class attributes to Alpine data
???????????????????????? ????????????????????:
???? Github: https://github.com/bugbytes-io/django-taggit-demo
???? Blog: https://www.bugbytes.io/posts/creating-scheduled-tasks-with-django-crontab/
???? Twitter: https://twitter.com/bugbytesio
???? ???????????????????????????? ???????????????????????????? ???????????? ????????????????????????????????????????????:
Starter Code: https://github.com/bugbytes-io/django-taggit-demo/tree/master/starter
django-taggit: https://django-taggit.readthedocs.io/en/latest/
TailwindCSS: https://tailwindcss.com/docs/installation
Alpine.js: https://alpinejs.dev/start-here
#python #django #tags #tailwindcss