filmov
tv
Python Django Tutorial #6: Django Class Based Views (CBV), Django Mixins | Django blog project
Показать описание
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 @:
============ SOURCE CODE ================
📎️ The SOURCE CODE is available via Patreon:
======================================
✴️✴️✴️ Web Scraping course ✴️✴️✴️
is available via Patreon here:
or its landing:
➥ Please ➥ Like ➥ Comment ➥ Subscribe
▶️ This Django blog tutorial. List of videos:
#0. Demo
#1. Django Project Structure
#2. Routing and Handling requests
#3. Template Inheritance
#4. Models. Blog Posts
#5. Tag Model and ManyToMany Relationships
#6. Django Class Based Views, Django Mixins
#7. Django Forms. Creating Tags.
#8. Forms. Creating Posts
#9. Updating via Forms
#10. Deleting via Forms
#11. Using custom CSS
#12. Restricting access
#13. Django Pagination
#14. Django Basic Search
✴️✴️✴️ PLAYLISTS ✴️✴️✴️
🔹Django 3 Tutorial: Blog Engine
🔹Kivy Tutorial: Coppa Project
🔹Telegram Bot with Python (CoinMarketCap)
🔹Python Web Scraping
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥
Red Eyed Coder Club is the best place to learn Python programming and Django:
Python Django Tutorial #6: Django Class Based Views (CBV), Django Mixins | Django Crash Course
#django #djangocbv #redeyedcoderclub
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 @:
============ SOURCE CODE ================
📎️ The SOURCE CODE is available via Patreon:
======================================
✴️✴️✴️ Web Scraping course ✴️✴️✴️
is available via Patreon here:
or its landing:
➥ Please ➥ Like ➥ Comment ➥ Subscribe
▶️ This Django blog tutorial. List of videos:
#0. Demo
#1. Django Project Structure
#2. Routing and Handling requests
#3. Template Inheritance
#4. Models. Blog Posts
#5. Tag Model and ManyToMany Relationships
#6. Django Class Based Views, Django Mixins
#7. Django Forms. Creating Tags.
#8. Forms. Creating Posts
#9. Updating via Forms
#10. Deleting via Forms
#11. Using custom CSS
#12. Restricting access
#13. Django Pagination
#14. Django Basic Search
✴️✴️✴️ PLAYLISTS ✴️✴️✴️
🔹Django 3 Tutorial: Blog Engine
🔹Kivy Tutorial: Coppa Project
🔹Telegram Bot with Python (CoinMarketCap)
🔹Python Web Scraping
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥
Red Eyed Coder Club is the best place to learn Python programming and Django:
Python Django Tutorial #6: Django Class Based Views (CBV), Django Mixins | Django Crash Course
#django #djangocbv #redeyedcoderclub
Комментарии