ViewsΒΆ
File: ./blog/views.py
Explanation:
In this file, you will find all the views classes and functions related to the Blog application of the project.
In this file, we have the following views classes and functions:
home(function): The function to load the home page of the Blog along with all the published posts.
search(function): A function to handle the search query submit by user via the search input form on blog home page.
category(function): A function return the blog posts related to a category.It will take the name of the category as the input.
post_detail(function): A function to get a single post detail page. It will take the ID of the post you want to get as the input.
PostCreate(class): A class to handle the creation of a new Blog Post.Upon the GET request it will load the page with a form to fill for the new post and on the POST request, it will check the permission against the user and save the new post to database.
delete_post(function): A function to delete a single post. It will take the ID of the post you want to delete.
comment(function): A function to post comment on a single blog post.