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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:59:23+00:00 2026-05-14T01:59:23+00:00

everyone. I’m just starting with django, so sorry for a possibly stupid question. Imagine,

  • 0

everyone. I’m just starting with django, so sorry for a possibly stupid question.

Imagine, I have a webpage with 3 logical pieces: content, dynamic menu, banners. It seems ok to me to have a template with something like:

{% include "banners.html" %}
{% include "menu.html" %}
{% include "content.html" %}

But then, how do I do it? Every piece has its separate logic in a separate view in its’ separate app. How do I trigger execution of all three views and render all three templates?

P.S. Is there a sourceforge-like site for django apps where I could take a look at how people are doing stuff in real projects?

  • 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-14T01:59:23+00:00Added an answer on May 14, 2026 at 1:59 am

    The standard way to do it is something as follows:

    Templates:

    • Have a base.html that has the banners, menu and a body block which is empty.
    • For each template, extend the base.html and override the body block.

      {% extends "base.html" %}
          {% block body %}
          -- Your this page's content goes here.
          {% endblock %}
      
    • You can use the includes, where necessary, but prefer the extends where possible. Include was debated to be included in the template language.

    Populating Context:

    You now have a lot of templates with placeholders that need to be replaced with the real “context” values.

    • Pass the RequestContext, that should contain many standard requirements for the template.
    • For the values that you need in every template, write a template context processor.
    • Those context’s that you need in this template, you populate in the view.

    Using multiple app’s views:

    • Most apps written for reuse will include template_name as a standard parameter, along with extra_context. You will need to call those views with these parameters.
    • Some apps go out of their way, to create a lazily evaluated response (like TemplateResponse) so that you can grab the context they populate, in your view.

    Django reusable apps:

    Are you kidding me? They are all over the Internet!

    http://github.com/search?q=django&type=Everything

    http://bitbucket.org/repo/all/?name=django

    http://code.google.com/hosting/search?q=django&projectsearch=Search+projects

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

Sidebar

Related Questions

Everyone, I am a newbie to android development. Now I have a question that
everyone, I have some question about C++, what do You actually prefer to use
everyone! I have sprite moving by action, what have health bar (progress bar). When
everyone seems interested in building IPhone apps today. Do you have to have an
everyone: I am also open to just straight-up refactoring what I'm finding to be
everyone, I've started working yesterday on the Euler Project in Clojure and I have
everyone The problem is if there exists two exported components which have the same
everyone I got a question , I want to implement a UI , Like
everyone, I have this piece of the code: void foo(int var, int var1) {
everyone, I have a big file in the format given below. The data is

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.