Django Quiz
How well do you know Django now? Answer these questions to check what you learned in this tutorial.
Tips
- Try each question from memory first
- Read the explanation even when you are right
- If you miss a question, go back to that lesson and run its code again
Quiz Questions
Exercise
1. What does MVT stand for in Django?
Exercise
2. Which command creates a new app called blog?
Exercise
3. What must every Django view return?
Exercise
4. In path("<int:pk>/", views.detail), what does <int:pk> do?
Exercise
5. Which template tag makes a page reuse the layout of base.html?
Exercise
6. What does python manage.py makemigrations do?
Exercise
7. Which line makes a model appear in the Django admin?
Exercise
8. What happens if Course.objects.get(name="Python") finds no row?
Exercise
9. Why do Django POST forms need {% csrf_token %}?
Exercise
10. Which command gathers all static files into STATIC_ROOT for a live server?
What Next?
Well done! Build a small project, such as a course registration site with the admin, a ModelForm and a nice template. Then learn about Django's built-in login system and the Django REST Framework, and put your code on GitHub with Git.
