Challenge 1: Define and Migrate a Model — Possible Solution ==================================================================== # catalog/models.py from django.db import models class Author(models.Model): name = models.CharField(max_length=150) bio = models.TextField(blank=True, null=True) birth_year = models.IntegerField(blank=True, null=True) def __str__(self): return self.name # Commands to create and apply the migration: python manage.py makemigrations catalog # Migrations for 'catalog': # catalog/migrations/0002_author.py # - Create model Author python manage.py migrate # Applying catalog.0002_author... OK WHY THIS WORKS -------------- - name uses CharField with a max_length, appropriate for a short, bounded piece of text — a person's name is never going to need TextField's unlimited length. - bio uses TextField (correct for potentially long, free-form text) with both blank=True and null=True, since a bio is genuinely optional: an author record should be valid with no bio at all, both at the database level (null) and at the form/validation level (blank). - birth_year uses IntegerField, also optional with blank=True and null=True — some authors' birth years may simply be unknown, so it shouldn't be a required field. - __str__ returns the author's name so that Author objects display meaningfully in the admin site and Django shell, instead of the default "Author object (1)". - makemigrations is run with the app name (catalog) explicitly, though running it with no arguments would also detect this new model — being explicit is a good habit in a project with multiple apps, so you know exactly which app's changes are being captured.