Catalog
Django Store most of the information related to the project in the database , So we need to create one for Django send Database used . For the project “ Learning notes ” Create database , Please perform the following... While in the active virtual environment The order of :
python manage.py migrate
Then the following page appears :
Run the command again :
dir
The result is the following page :
We call modifying a database migration database . Execute the command for the first time migrate when , Will let Django Make sure that the database matches the item The current state of the destination matches . In the use of SQLite( More details on ) When this command is first executed in a new project , Django A new database will be created . Here ,Django Indicate that it will create the necessary database tables , For storage, we'll be here A project (Synchronize unmigrated apps, Synchronize non migrated applications ) Information used in , Then ensure that the database is closed Construct with current code (Apply all migrations, Apply all migrations ) matching . We ran the command dir, Its output indicates Django Created another file ——db.sqlite3.SQLite yes A database that uses a single file , Ideal for writing simple applications , Because it allows you not to pay too much attention to database management .