Quiz
1. Which of the following command is used to create a new migration file ?
a. python manage.py migrate
b. python manage.py createmigrations
c. python manage.py makemigrations
d. python manage.py makemigration
Answer
c. Using python manage.py makemigrations command, we create a new migration file.
2. Which of the following command is used to migrate changes in the database from the migration file ?
a. python manage.py migrate
b. python manage.py applymigrations
c. python manage.py makemigrations
d. python manage.py migrates
Answer
a. Using python manage.py migrate command, we apply changes of migration file to the database.
3. Which model field type is used to implement Many-to-One relationship in Django?
a. ManyToOne
b. ForeignKey
c. ManyToMany
d. ManyToManyField
Answer
b. ForeignKey
4. Which model field type is used to implement Many-to-Many relationship in Django?
a. ManyToOne
b. ForeignKey
c. ManyToMany
d. ManyToManyField
Answer
d. ManyToManyField
5. How many characters CharField can store ?
a. 265
b. 255
c. 256
d. 266
Answer
b. 255