Creating a Database

Django includes several applications by default (e.g., the admin program and user management and authentication). Some of these applications make use of at least one database table, so we need to create tables in the project database before we can use them. To do this, change into the myclub_site folder created in the last step (type cd myclub_site at the command prompt) and run the following command:

  1. python manage.py migrate

The migrate command creates a new SQLite database and any necessary database tables, according to the settings file created by the startproject command (more on the settings file later). If all goes to plan, you’ll see a message for each migration it applies:

  1. (env_myclub) ...\myclub_site>python manage.py migrate
  2. Operations to perform:
  3. Apply all migrations: admin, auth, contenttypes, sessions
  4. Running migrations:
  5. Applying contenttypes.0001_initial... OK
  6. Applying auth.0001_initial... OK
  7. Applying admin.0001_initial... OK
  8. # several more migrations (not shown)