Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 3 subjective questions Templates, Debugging and Testing

INT253 — Web Development In Python Using Django 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define a Django template. Explain its role in Django's Model-Template-View architecture.

  2. Question 2 of 20

    Describe the steps required to create, configure, and render a template in a Django project.

  3. Question 3 of 20

    Explain the main components of Django Template Language (DTL), with suitable examples.

  4. Question 4 of 20

    Explain how Django template variables are resolved. What happens when a variable does not exist?

  5. Question 5 of 20

    What are Django template tags? Describe any five commonly used template tags.

  6. Question 6 of 20

    Describe the use of the for tag in Django templates. Explain loop variables and the {% empty %} clause.

  7. Question 7 of 20

    Explain the syntax and working of if, elif, and else statements in Django templates. Mention the operators supported by DTL conditions.

  8. Question 8 of 20

    What are template filters in Django? Explain how filters are applied and describe any five built-in filters.

  9. Question 9 of 20

    Explain how dynamic templates are created in Django by passing context data from a view. Illustrate the complete request-to-response flow.

  10. Question 10 of 20

    What is template inheritance in Django? Create a conceptual parent-child template structure and explain how it avoids duplication.

  11. Question 11 of 20

    Distinguish between {% extends %}, {% block %}, and {% include %} in Django templates.

  12. Question 12 of 20

    Explain the importance of automatic HTML escaping in Django templates. Compare the escape, safe, and autoescape features.

  13. Question 13 of 20

    A view passes {'numbers': [2, 5, 8, 11]} to a template. Write and explain DTL logic that displays whether each number is even or odd and shows a message when the list is empty.

  14. Question 14 of 20

    Explain how Django's debugging mode works. Why must DEBUG be disabled in a production environment?

  15. Question 15 of 20

    Describe a systematic procedure for debugging common Django template errors.

  16. Question 16 of 20

    Explain how logging can be used to debug a Django application. Compare logging with temporary print() statements.

  17. Question 17 of 20

    Define testing in Django. Explain the structure and life cycle of a test case created using django.test.TestCase.

  18. Question 18 of 20

    Describe how Django's test client can be used to test a view, its status code, template, context, and rendered content.

  19. Question 19 of 20

    Distinguish between unit testing, integration testing, and functional testing in the context of a Django application.

  20. Question 20 of 20

    Design a comprehensive testing strategy for a Django page that displays a dynamic student list using template inheritance, loops, and conditional statements.

That's unit 3

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.