0
0
Djangoframework~10 mins

makemigrations and migrate commands in Django - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create new migration files for your Django app.

Django
python manage.py [1] myapp
Drag options to blanks, or click blank then click option'
Arunserver
Bmakemigrations
Cmigrate
Dcreatesuperuser
Attempts:
3 left
💡 Hint
Common Mistakes
Using migrate instead of makemigrations to create migration files.
Forgetting to specify the app name.
2fill in blank
medium

Complete the code to apply all pending migrations to the database.

Django
python manage.py [1]
Drag options to blanks, or click blank then click option'
Amakemigrations
Brunserver
Cshell
Dmigrate
Attempts:
3 left
💡 Hint
Common Mistakes
Running makemigrations when intending to update the database.
Not running migrate after creating migrations.
3fill in blank
hard

Fix the error in the command to apply migrations only for the 'blog' app.

Django
python manage.py migrate [1]
Drag options to blanks, or click blank then click option'
Aapp=blog
B--app blog
Cblog
Dmigrate blog
Attempts:
3 left
💡 Hint
Common Mistakes
Using flags like --app which are not valid for migrate.
Repeating the migrate command inside the command.
4fill in blank
hard

Fill both blanks to create and apply migrations for the 'shop' app.

Django
python manage.py [1] shop && python manage.py [2] shop
Drag options to blanks, or click blank then click option'
Amakemigrations
Bmigrate
Crunserver
Dcreatesuperuser
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of commands.
Using runserver instead of migrate.
5fill in blank
hard

Fill all three blanks to create migrations, apply them, and then start the development server.

Django
python manage.py [1] && python manage.py [2] && python manage.py [3]
Drag options to blanks, or click blank then click option'
Amakemigrations
Bmigrate
Crunserver
Dshell
Attempts:
3 left
💡 Hint
Common Mistakes
Skipping migrate before running the server.
Using shell instead of runserver to start the server.