O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.5.3 Applying Migrations to Create or Modify a Database

The command to run the code in the migrations files, colloquially called applying a migration, is migrate. If you’ve been following closely, you already used the command in Chapter 1, before we used the runserver command. Calling the command created a default SQLite database, which Django requires to run on a server.

Regardless of whether you already have a database, you will now call migrate again, as in Example 3.33.

Example 3.33: Shell Code

$ ./manage.py migrate

If you don’t already have a database, Django will create one named db.sqlite3, as specified on line 64 of /suorganizer/settings.py. Django will also produce the output shown in Example 3.34.

Example 3.34: Shell Code

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required