django create model | django database

1) Create tables  Album and Song in Music app  using model.py


2) Add  music app  in website/setting.py



3) make migration in music app
command: website> python manage.py makemigrations music



4) check sql migration before final migrate or changes to database
command: python manage.py sqlmigrate music 0001




.
5) if satisfied with sql  result, do final commit to database using migrate
command: python manage.py migrate




Reactions:

0 comments:

Post a Comment