Add Blog Categories - Django Blog #12

Add Blog Categories - Django Blog #12

In this video we'll start to add categories to our blog with Django.



So you've got a blog, but you want to be able to designate a 'category' for each blog post. We'll start out by adding a category field to our Post database model. Then we'll create a whole new model named Category.

This new model will allow us to add, edit, or remove Categories from the blog itself in the future (as opposed to just hard coding in the categories on the backend).


After that we'll modify our forms.py file so that we can designate a category for each new blog post we make.

django blog categoriesdjango blog categoryadding categories django blog

Post a Comment

0 Comments