Premier League Predictor: Django & MySQL — Chapter 1, Exercise 3 ==================================================== TASK Set up the pl_predictor MySQL database and a working Django project connected to it yourself (using either mysqlclient or the PyMySQL alternative), confirm python manage.py migrate runs successfully, and write one sentence explaining what that command actually confirmed. SOLUTION Steps to complete this exercise: 1. Create the database in a MySQL client: CREATE DATABASE pl_predictor CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 2. Create and activate a virtual environment, then install Django and a real driver — either: pip install django mysqlclient or, if mysqlclient's own build dependencies aren't available: pip install django PyMySQL (and, if using PyMySQL, add the two-line shim to the very top of manage.py: import pymysql; pymysql.install_as_MySQLdb()) 3. Create the project and app: django-admin startproject pl_predictor_site . python manage.py startapp predictor 4. Set DATABASES in pl_predictor_site/settings.py exactly as shown in the chapter, pointing at the real pl_predictor database with the utf8mb4 charset in OPTIONS, and add 'predictor' to INSTALLED_APPS. 5. Run: python manage.py migrate This should complete without error, printing a real, dated list of Django's own built-in migrations being applied (for auth, admin, contenttypes, sessions, and so on). 6. Run python manage.py runserver and confirm the default Django welcome page loads at http://localhost:8000/. One-sentence answer for the write-up: python manage.py migrate confirmed that Django could actually open a real connection to the pl_predictor MySQL database using the credentials and charset settings in DATABASES, and successfully created Django's own built-in tables inside it — proof the database connection genuinely works, not just that the Python code itself has no syntax errors. WHY THIS WORKS AS AN ANSWER ---------------------------- It walks through every real setup step in order (database creation, driver installation with both real options, project scaffolding, settings configuration, and running the actual migration), and closes with a one-sentence answer that correctly identifies migrate as a real proof of database connectivity, not merely a Django-internal operation.