Home > Django > Quizzes > Django Quiz
Django Quiz
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 20% Most missed: “Which command would you use to apply a migration?”

Django MCQs For LinkedIn Skill Assessments.

Django Quiz
Time left 00:00
25 Questions

1. Which is not a Django filed type for integers?
2. You have inherited a Django project and need to get it running locally. It comes with a requirements.txt file containing all its dependencies. Which command should you use?
3. You want to create a page that allows editing of two classes connected by a foreign key (e.g., a question and answer that reside in separate tables). What Django feature can you use?
4. What executes various Django commands such as running a webserver or creating an app?
5. When does this code load data into memory?

1 sandwiches = Sandwich.objects.filter(is_vegan=True)
2 for sandwich in sandwiches:
3 print(sandwich.name + ' - ' + sandwich.spice_level)
6. What is WSGI?
7. What is the correct way to begin a class called 'Rainbow' in Python?
8. How should the code end?

{ percentage if spark >= 50 percentage }
Lots of spark
{percentage elif spark == 42 percentage}
9. Which function of Django's Form class will render a form's fields as a series of

tags?

10. How would you stop Django from performing database table creation or deletion operations via migrations for a particular model?\*\*
11. To cache your entire site for an application in Django, you add all except which of these settings?
12. Which class allows you to automatically create a Serializer class with fields and validators that correspond to your model's fields?
13. In Django, what are used to customize the data that is sent to the templates?
14. Which function in the django.urls package can help you avoid hardcoding URLS by generating a URL given the name of a view?
15. Why are QuerySets considered 'lazy'?
16. How would you define the relation between a book and an author - book has only one author.
17. What do Django best practice suggest should be 'fat'?
18. You should use the http method '___' to read data and '___' to update or create data
19. What is a callable that takes a value and raises an error if the value fails to meet some criteria?
20. A project has accumulated 500 migrations. Which course of action would you pursue?
21. Which is Fictional HTTP request method?
22. Which variable name is best according to PEP 8 guidelines?
23. To complete the conditional, what should this block of code end with?
shell
% if sparles >= 50 %
Lots of sparkles!
% elif sparkles == 42 %
The answer to life, the universe, and everything!
24. What will this URL pattern match? url(r'^\$', views.hello)
25. What is the result of this template code?

{{'live long and prosper'|truncate:3}}

⚡ Recently practiced quizzes in this topic
Live quiz activity