This Python Django Tutorial is about Django Class Based Views or Django CBV, and using of Django Mixins. This is the 6th part of my Python Django tutorial. In this Django tutorial we'll figure out what are Django Class Based Views (CBV), what are Django Mixins and how Django mixins work, and also how to use them.
Class Based Views in Django are just Python classes that handles user response, like functions, that we wrote before. Each CBV has get(), post() and other method that handle get or post requests respectively.
The benefit of using Django Class Based Views is that we can use inheritance.
And the Inheritance mechanism allows us to use Django mixins.
Mixins are just Python classes that contains common behavior for each Django CBV that you want to create.
For example, creating of posts and tags for our Django blog requires from us to perform almost identical actions.
The difference between creating a post and tags - are just in the name of a model, a template to render, and returning object that's it.
And so we can create a Django mixin that will contain common behavior for each Django class based view.
In this Django mixins tutorial I use a low level method. I use the generic View class to create Django mixins and cbv. BECAUSE it's a Django Mixins and Django Class Based View TUTORIAL!!!
ListView and other GCBV can use anyone. But I think that it's necessary to understand how Django mixins and Django Class Based Views work under the hood. And that is why I don't use GCBV in this Django Class Based Views tutorial.
Follow me @:
Telegram: t.me/red_eyed_...
Twitter: / codereyed
Facebook: fb.me/redeyedc...
============ SOURCE CODE ================
📎️ The SOURCE CODE is available via Patreon:
/ django-3-blog-34240101
======================================
✴️✴️✴️ Web Scraping course ✴️✴️✴️
is available via Patreon here:
/ red_eyed_coder_club
or its landing:
red-eyed-coder...
➥ Please ➥ Like ➥ Comment ➥ Subscribe
▶️ This Django blog tutorial. List of videos:
#0. Demo
• Python Django Tutorial...
#1. Django Project Structure
• Python Django Tutorial...
#2. Routing and Handling requests
• Python Django Tutorial...
#3. Template Inheritance
• Python Django Tutorial...
#4. Models. Blog Posts
• Python Django Tutorial...
#5. Tag Model and ManyToMany Relationships
• Python Django Tutorial...
#6. Django Class Based Views, Django Mixins
• Python Django Tutorial...
#7. Django Forms. Creating Tags.
• Python Django Tutorial...
#8. Forms. Creating Posts
• Python Django Tutorial...
#9. Updating via Forms
• Python Django Tutorial...
#10. Deleting via Forms
• Python Django Tutorial...
#11. Using custom CSS
• Python Django Tutorial...
#12. Restricting access
• Python Django Tutorial...
#13. Django Pagination
• Python Django Tutorial...
#14. Django Basic Search
• Python Django Tutorial...
✴️✴️✴️ PLAYLISTS ✴️✴️✴️
🔹Django 3 Tutorial: Blog Engine
• Python Django Tutorial...
🔹Kivy Tutorial: Coppa Project
• Python Kivy tutorial #...
🔹Telegram Bot with Python (CoinMarketCap)
• Python Telegram Bot Tu...
🔹Python Web Scraping
• Python Ebay Scraping T...
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥
Red Eyed Coder Club is the best place to learn Python programming and Django:
Subscribe ⇢ / @redeyedcoderclub
Python Django Tutorial #6: Django Class Based Views (CBV), Django Mixins | Django Crash Course
• Python Django Tutorial...
#django #djangocbv #redeyedcoderclub
Негізгі бет Python Django Tutorial #6: Django Class Based Views (CBV), Django Mixins | Django blog project
Пікірлер: 35