Creating Django Models

What you'll learn

In this Project you’ll follow along with our instructions to add Django models to a blog.

  1. Start with a basic blog that has static data and refactor it to use a persistent post model.
  2. Create a user app with a user model that extends Django's UserAdmin model to provide authentication.
  3. Replace existing static blog post data with a Blog Post model that is connected to a database.
  4. Add features to the blog by adding “tags” and a user models that relate to the post model.

Table of contents

Setup
1h
  • Set up your local environment for projects. We'll walk you through everything you need to know, including how to install and configure your environment to be able to complete all of the tasks.
Add User Authentication
30m
  • In this module, we're going to create a user app with a user model that extends Django's UserAdmin model to provide authentication.
Add Blog Posts Model
30m
  • In this module, we will replace existing static blog post data with a Blog Post model that is connected to a database.
Add Tag Model
30m
  • In this module, we will add tags to each post in order to organize them better by topic. To do that we'll create a new `Tag` model with a relationship to the `BlogPost` model.

Course FAQ

What are models in Django used for?
Who is this project for?
What will I learn in this project?
What prerequisites do I need?

About the author

Will Holderness is the Vice President of Product for UniKey Technologies in Orlando, Florida. He has a Master's degree and Bachelor's degree in Computer Engineering from University of Central Florida. Will is a firmware engineer at heart but also has experience doing mobile app, frontend, and backend web development in various languages. He's been doing software development since he first learned C++ in 2002 and loves picking up new technologies & languages. When not glued to a computer screen,... more

Ready to upskill? Get started