Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3274532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:02:56+00:00 2026-05-17T19:02:56+00:00

To illustrate my question more clearly, let’s suppose I have a include.html template with

  • 0

To illustrate my question more clearly, let’s suppose I have a include.html template with content:

{% block test_block %}This is include{% endblock %}

I have another template called parent.html with content like this:

This is parent

{% include "include.html" %}

Now I create a templated called child.html that extends parent.html:

{% extends "parent.html" %}
{% block test_block %}This is child{% endblock %}

My idea is that when rendering child.html, the test_block in child.html can overwrite the one in include.html. As per my understanding, when a template is included, it is included as it is. So in my case, I think parent.html equals to:

This is parent

{% block test_block %}This is include{% endblock %}

So child.html should be able to overwrite test_block. But looks like it can’t. Why? Is there a workaround?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:02:57+00:00Added an answer on May 17, 2026 at 7:02 pm

    When you include a template, it renders the template, then includes the rendered content.

    From the django docs:

    The include tag should be considered as an implementation of “render this subtemplate and include the HTML”, not as “parse this subtemplate and include its contents as if it were part of the parent”. This means that there is no shared state between included templates — each include is a completely independent rendering process.

    A workaround would be to have the child template extend the included template instead of the including template. Then, include the child template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simplified example to illustrate the question: class A {}; class B
(I have a problem that I illustrated in this question but had no correct
To explain my question, let me first point to this array: <?php $_depends =
I'm not sure, if this is really a question or more an observation -
So I am primarily a C# and Java developer but I suppose this question
I have an OO design question. I've written the (pseudo)-pseudocode below to help illustrate
I will try and illustrate my question with examples, I am attempting to create
This is a question best illustrated by example: User goes to Site A ,
I'm trying to illustrate a doubly linked list problem. this is from an old
I'll attempt to illustrate this with an example. Take a common example of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.