Django MCQ2
Django MCQ2
Django MCQ2
o a) A programming language
o b) A web framework
o c) A database
o d) An IDE
o a) urls.py
o b) settings.py
o c) models.py
o d) views.py
o Answer: b) settings.py
o a) Model-View-Controller (MVC)
o b) Model-Template-View (MTV)
o c) View-Controller-Model (VCM)
o a) django-admin createproject
o b) django-admin startproject
o d) django-admin makemigrations
o d) django-admin syncdb
o a) urls.py
o b) views.py
o c) models.py
o d) settings.py
o Answer: c) models.py
o b) By setting primary_key=True
o a) all()
o b) get()
o c) filter()
o d) exclude()
o Answer: a) all()
o b) django-admin runserver
o c) django-admin startproject
o a) Jinja2
o b) Mustache
o d) Mako
12. Which of the following is NOT a valid field type in Django models?
o a) CharField
o b) IntegerField
o c) AutoField
o d) TextboxField
o Answer: d) TextboxField
o a) @login_required
o b) @admin_only
o c) @restrict
o d) @auth_required
o Answer: a) @login_required
o b) django-admin createsuperuser
o d) django-admin startproject
o a) views.py
o b) urls.py
o c) models.py
o d) admin.py
o Answer: b) urls.py
o a) @transaction.atomic()
o b) @transaction.commit()
o c) @transaction.savepoint()
o d) @transaction.rollback()
o Answer: a) @transaction.atomic()
o a) PostgreSQL
o b) MySQL
o c) SQLite
o d) Oracle
o Answer: c) SQLite
o a) runserver
o b) makemigrations
o c) migrate
o d) execute
o Answer: d) execute
o a) Forms API
o b) HTTP API
o c) Query API
o d) Session API
o a) urlpatterns
o b) urlconf
o c) urlhandler
o d) routelist
o Answer: a) urlpatterns
26. Which of the following are valid types of fields in Django models?
o a) CharField
o b) DateField
o c) BooleanField
o d) TimeField
27. Which of the following are valid HTTP methods used in Django views?
o a) GET
o b) POST
o c) PUT
o d) DELETE
o a) makemigrations
o b) migrate
o c) sqlmigrate
o d) showmigrations
o a) ForeignKey
o b) OneToOneField
o c) ManyToManyField
o d) IntegerField
30. Which of the following are valid options for ordering query results in Django?
o a) order_by()
o b) filter_by()
o c) exclude()
o d) reverse()