Skills Expanded

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?

Models are how Django apps access and manage data. Once you've set up a model for your app, it acts as a middle man - drawing from the database for you.

Who is this project for?

This project is great for starting Python Django developers looking to build better, smarter, and faster.

What will I learn in this project?

In this project, we will create a simple app to add various Django models to - including UserAdmin for authentication, a database-connected blog post model, and a taag model to interact with the blog post model.

What prerequisites do I need?

This is a beginner-level project but you will want to have at least a basic knowledge of Python's Django framework.

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