Bird
0
0

Which of the following is the correct command to create new migration files after changing Django models?

easy📝 Syntax Q12 of 15
Django - Deployment and Production
Which of the following is the correct command to create new migration files after changing Django models?
Apython manage.py runserver
Bpython manage.py migrate
Cpython manage.py makemigrations
Dpython manage.py flush
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command for creating migrations

    makemigrations scans model changes and creates migration files.
  2. Step 2: Confirm other commands' purposes

    migrate applies migrations, runserver starts server, flush clears data.
  3. Final Answer:

    python manage.py makemigrations -> Option C
  4. Quick Check:

    makemigrations creates files = A [OK]
Quick Trick: makemigrations creates files, migrate applies them [OK]
Common Mistakes:
MISTAKES
  • Using migrate instead of makemigrations to create files
  • Confusing runserver with migration commands
  • Using flush to manage migrations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes