Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/OpenClassrooms-Student-Center/Python-OC-Lettings-FR/llms.txt

Use this file to discover all available pages before exploring further.

The Profiles feature gives visitors a directory of registered users on Orange County Lettings. Each profile is tied to a Django User account and optionally records that user’s favorite city. From the profiles index, visitors can see all registered usernames; clicking a name opens the individual profile page with the user’s details.

Profiles index

Route: GET /profiles/ The profiles index page retrieves all Profile objects and renders each associated username as a clickable link. Clicking a username navigates to that user’s profile detail page. If no profiles exist, the page displays a “No profiles are available.” message instead of an empty list.

Profile detail page

Route: GET /profiles/<username>/ The detail page looks up a Profile by matching the username field of its linked User. It renders:
  • Username — displayed as the page heading
  • First name — from the linked User record
  • Last name — from the linked User record
  • Email — from the linked User record
  • Favorite city — from the Profile record (may be blank)

Data model

Profile

Each Profile extends Django’s built-in User model with a single additional field:
class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    favorite_city = models.CharField(max_length=64, blank=True)
FieldTypeConstraints
userFKOne-to-one link to django.contrib.auth.models.User; deletes cascade
favorite_cityStringMaximum length: 64 characters; optional
favorite_city is optional (blank=True). If a user has not set a favorite city, the field is stored as an empty string and the detail page renders nothing for that field.

Explore other features

Holiday home listings

Browse all available rental properties and view their full addresses.

Admin panel

Manage lettings, addresses, and profiles through the Django admin interface.

Build docs developers (and LLMs) love