22.2 Creating a User Profile

The user profile is a fairly common website feature. It allows users to list their location, birth date, favorite pizza toppings, and whatever else the developer allows them to add. In the next few sections, we create a very simple Profile model for the user to display. We create a page to display the user’s own profile as well as a page to display profiles to other users. While these two pages use different views, they rely on the same template. We therefore also create a webpage to allow users to update their profile, but we ensure that each user has a profile as soon as the User instance is created.

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.