Explore how to create a way to tag your posts.
- [Instructor] In our previous video,…we saw how to add comments to the post detail template.…This is the fifth video, "Adding Tagging Functionality."…In this video, we'll see how to tag the posts.…After implementing our comment system,…we're going to create a way to tag our posts.…We're going to do this…by integrating a third-party django-tagging application…in our project.…Django-taggit is a reusable application…that primarily offers you a tag model…and a manager to easily add tags to any model.…
You can a look at its source code at this GitHub link.…First, you need to install django-taggit via pip.…For that, you open the terminal and run this command.…As you can see, it's already installed here.…We then open the settings.py file…of the mysite project and add taggit…to your installed underscore apps setting like this.…Open the models.py file of your blog application…and add the TaggableManager provided by django-taggit…to the post model using this code.…
The tags manager will allow you…to add, retrieve, and remove tags from post objects.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Building a blog application
- Creating an administration site for your models
- Creating templates for your views
- Using class-based views
- Enhancing your blog with advanced features
- Creating and handling forms
- Adding tagging functionality
- Extending your blog application
- Creating custom template tags and filters