Python Interview questions - django
(Python version 3.9 or later version)
What method is used instead of path() in urls.py to pass in regular expressions as routes?
url( ) )
include( )
static( )
re_path( )
Django is based on which framework?
MVC (Model-View-Controller)
MVVM (Model-View-View-Model)
MVT (Model-View-Template)
MVP (Model-View-Presenter)
Which of the following is an invalid template tag?
{% while %}
{% ifequal %}
{% If %}/ {% else %}
{% for key in dictionary %}
Python Interview Questions
  • Python - Django
    1. What file do you use to map your database? (Django)
    A) settings.py
    B) models.py
    C) urls.py

    Answer: models.py
    2. What are your Django HTML files called?
    A) Views
    B) Models
    C) Templates

    Answer: Templates
    3. What takes the data from the model and merges it with the template? (Django)
    A) Settings
    B) Views
    C) Project

    Answer: Views
    4. What Django tag is used to define where HTML pages will include unique data from what is provided in the base template?
    A) content
    B) block
    C) {}

    Answer: block
    5. What file matches up URL paths to class views? (Django)
    A) urls.py
    B) settings.py
    C) apps.py

    Answer: urls.py
  • gk