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 8576223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:52:45+00:00 2026-06-11T19:52:45+00:00

I have a view that returns a page from my template dir, successfully, no

  • 0

I have a view that returns a page from my template dir, successfully, no problem:

def home(request):
    c = {}
    return render_to_response('home.html', c, context_instance=RequestContext(request))

If home.html is a simple webpage with no extends, it returns fine.

However, if I use an include, say {% extends “base.html” %}, it simply returns the base.html without adding in the content from the child home.html. What could be causing this?

home.html

{% extends "base.html" %}
{% block title %}Home{% endblock %}
{% block content %}
This is the homepage.
{% endblock %} 

base.html

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{% block content %}{% endblock %}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

At the moment, this is returning a copy of base.html like this:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>

<body>

</body>

</html>

Why is it not including the content or title block?

  • 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-06-11T19:52:46+00:00Added an answer on June 11, 2026 at 7:52 pm

    In your base.html block named content is appearing twice. You may want to name first block as title e.g. {% block title %}{% endblock %}

    Django recommends that you shouldn’t define multiple template blocks with same name.

    From Template inheritance

    Finally, note that you can’t define multiple block tags with the same name in the same template. This limitation exists because a block tag works in “both” directions. That is, a block tag doesn’t just provide a hole to fill — it also defines the content that fills the hole in the parent. If there were two similarly-named block tags in a template, that template’s parent wouldn’t know which one of the blocks’ content to use.

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

Sidebar

Related Questions

I have a django view that returns HTTP 301 on a curl request: grapefruit:~
Im having a very strange problem, i have a complicated view that returns incorrect
I have an action that returns a view with a master page with a
I have a backbone.js View that reads a template from the HTML file and
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a simple Django view that just returns URL parameters, but if I
If i have a controller action Create that returns a view with the following
I have a sub form that looks like a datasheet view. It returns prices
We have a view that, without constraints, will return 90 million rows and a
I have a view that renders a list elements using the following template :

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.