Django Quiz

10:00

Models, views, templates and security. · 10 questions

Question 1 of 10
Which command creates migration files?
Question 2 of 10
Django's architecture is often called…
Question 3 of 10
Which protects forms against CSRF?
Question 4 of 10
Which setting must be False in production?
Question 5 of 10
To avoid N+1 queries on a ForeignKey use…
Question 6 of 10
For the URL /posts/7/, what does the view receive?
path('posts/<int:pk>/', views.post_detail, name='post-detail')
Question 7 of 10
Which setting does `collectstatic` copy files into for production?
Question 8 of 10
Which call raises `Product.DoesNotExist` when nothing matches?
Question 9 of 10
How many database queries does this run?
qs = Post.objects.filter(published=True)
qs = qs.order_by('-created')
for p in qs[:5]:
    print(p.title)
Question 10 of 10
When should a project switch to a custom user model?