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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:57:03+00:00 2026-05-18T23:57:03+00:00

While setting up my project and working to keep apps non-dependent, I’ve hit a

  • 0

While setting up my project and working to keep apps non-dependent, I’ve hit a snag. I’d like all of the templates from the different apps to have a consistent header and footer. Here’s what I’m trying:

myproject/
         base/
             templates/
                      header.html
                      footer.html
         app1/
             templates/
                      my_app1_page.html -> want to include 'header.html'
                                           and 'footer.html' from base app

Pretend there are many more apps that want to do this as well. Is this possible and/or the right way to do it?

  • 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-18T23:57:04+00:00Added an answer on May 18, 2026 at 11:57 pm

    As long as the apps are in INSTALLED_APPS and the template loader for apps dirs is enabled, you can include any template from another app, i.e.:

    {% include "header.html" %}
    

    … since your templates are located directly in the templates dir of your app.
    Generally, in order to avoid name clashes it is better to use:

    app1/
        templates/
            app1/
                page1.html
                page2.html
    app2/
        templates/
            app2/
                page1.html
                page2.html
    

    And {% include "app1/page1.html" %} or {% include "app2/page1.html" %} …

    But: for keeping a consistent look and feel, it is so much better to use template inheritance rather than inclusion. Template inheritance is one of the really good things of the Django template system, choose inheritance over inclusion whenever it makes sense (most of the time).

    My recommendations:

    • Have a base template for your project (“base.html” is the default convention) with header and footer and a {%block content%} for your main content.
    • Have your other templates inherit form base.html {% extends "base.html" %} and override the content section

    See another response to this question for links to the doc

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

Sidebar

Related Questions

I'm currently working on setting up a new project of mine and was wondering
I'm working on a .NET 4 project, and would be able to benefit from
After working on a Django project for a while, I now have to do
While working on a small project I found myself needing to do some custom
I have been working for a while on a project with the following components:
I have a project that I've been working on for a while. It is
I have been working with System.DirectoryServices for a while in a project involving Active
While setting up CruiseControl, I added a buildpublisher block to the publisher tasks: <buildpublisher>
Any idea where the setting is hiding for turning gridlines off while using excel
What are your favorite Git configuration settings which make your life easy while working

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.