Django mock tests
Test yourself on the whole course, against the clock: questions from every module, then coding problems you solve and run right here. Your score comes at the end, with every answer explained.
Each mock test has 12 questions drawn from the lessons, and 45 minutes on the clock, which keeps running if you reload. Questions are worth a point each. Score 60% or more to pass; your best score is kept.
- 01Mock test 112 questions · 45 minutes · 12 points
- 02Mock test 212 questions · 45 minutes · 12 points
Part A · 12 questions
- Why give a new field a default when the table already has rows?
- Which tag shows a message when a list is empty?
- Which pattern captures a whole number from /lessons/12/?
- In Django's MVT pattern, which part defines the structure of the database tables?
- What does each attribute of a model class usually represent?
- Which method checks that two password fields match?
- After running startapp courses, what must you do before Django uses the app?
- What must every POST form in a Django template include?
- Why are app templates kept in courses/templates/courses/?
- What does python manage.py migrate do the first time?
- Which template tag produces the URL for a static file?
- What is the difference between a Django project and an app?
Part A · 12 questions
- After form.is_valid() returns True, where are the converted values?
- Why does update(price=F("price") - 50) use F?
- A Lesson has course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name="lessons"). How do you get a course's lessons?
- What must a Django view return?
- What does python manage.py collectstatic do?
- Course.objects.get(title="Rust") matches nothing. What happens?
- Which file maps URLs to views?
- Which command creates an account that can log in to the admin?
- You added a field to a model. Which commands bring the database up to date?
- Why does Django escape variables automatically?
- Why give URL patterns a name?
- A child template starts with {% extends "base.html" %}. What can it change?