Backend Development
Django
Subjective
Oct 03, 2025
Explain Django templates and template inheritance.
Detailed Explanation
Django templates separate presentation from logic using HTML with template tags.
Features:
• Variables {{ variable }}
• Tags {% tag %}
• Filters {{ variable|filter }}
• Comments {# comment #}
Template inheritance:
• Base template defines structure with {% block %} tags
• Child templates extend base with {% extends %} and override blocks
Benefits:
• Code reusability
• Consistent layout
• Easy maintenance
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts