Django MCQ1
Django MCQ1
Django MCQ1
Q2
Model-View-Controller (MVC)
Model-View-Presenter (MVP)
Model-Template-View (MTV)
Model-View-ViewModel (MVVM)
Q3
Java
C++
Python
D
Ruby
Q4
Q5
django-admin startapp
django-admin startproject
django startproject
django startapp
Q6
views.py
urls.py
C
settings.py
models.py
Q7
Q8
To render templates
Q9
Which Django template tag is used to insert the value of a variable into the template?
{{ variable }}
B
{% variable %}
{% include variable %}
{{ include variable }}
Q10
Q11
Q12
What is the default port number used when running the Django development server?
8000
8080
5000
3000
Q13
Which of the following is NOT a valid way to start the Django development server?
django-admin runserver
Q14
Which file is automatically generated when you create a new Django project?
views.py
urls.py
settings.py
manage.py
Q16
Q17
Python 2.7
Python 3.5
Python 3.6
D
Python 3.8
Q18
Q19
Q20
Q21
Q22
Q23
When running python manage.py runserver, you get an "Address already in use" error.
How can you resolve this?
Q24
To configure settings
Q25
templates
static
project_name
app_name
Q26
Q27
Which file contains the WSGI application used by Django’s development server?
settings.py
urls.py
wsgi.py
asgi.py
Q28
views.py
models.py
urls.py
D
admin.py
Q29
To configure settings
Hide Answer
Explanation
The init.py file indicates that the directory should be treated as a Python package. It is used to
initialize the app and can contain initialization code.
Q30
How do you include an app's URL patterns in the main project's urls.py file?
path('app_name/', include('app_name.urls'))
url('app_name/', include('app_name.urls'))
path('app_name/', include(app_name.urls))
include('app_name.urls')