0 votes
in Data Handling by
How do you connect your Django project to the database?

1 Answer

0 votes
by
Django comes with a default database which is SQLite. To connect your project to this database, use the following commands:

python manage.py migrate (migrate command looks at the INSTALLED_APPS settings and creates database tables accordingly)

python manage.py makemigrations (tells Django you have created/ changed your models)

python manage.py sqlmigrate <name of the app followed by the generated id> (sqlmigrate takes the migration names and returns their SQL)

Related questions

0 votes
asked Apr 3, 2020 in Data Handling by amita rallin
0 votes
asked Apr 3, 2020 in Data Handling by amita rallin
...