Now we are going to build a comment system for the blog, wherein the users will be able to comment on posts. To build the comment system, you will need to:
First, let's build a model to store comments. Open the
models.py file of your
blog application and add the following code:
class Comment(models.Model): post = models.ForeignKey(Post, related_name='comments') name = models.CharField(max_length=80) email = models.EmailField() body = models.TextField() created ...