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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:59:14+00:00 2026-06-07T16:59:14+00:00

How I can render template without extend? i have simple renderer and i want

  • 0

How I can render template without extend? i have simple renderer and i want after findout this request is ajax just render goal data

my template:

{% extends "base.html" %}
{% load i18n %}

{% block extrahead %}
{% endblock extrahead %}


{% block content %}

  <div class="itemBg">
    <div class="itemTop">
      <div class="itemDown">

        <div class="rowContainer">
            <div class="show att">
                {{ msg }}
            </div>
        </div>

</div></div></div>
{% endblock %}

only i want this in render response for ajax request.

  <div class="itemBg">
    <div class="itemTop">
      <div class="itemDown">

        <div class="rowContainer">
            <div class="show att">
                {{ msg }}
            </div>
        </div>

</div></div></div>

this is my render interface

from flask import current_app, render_template

def render(template, **context):
    """
    """
    return render_template(path(template), **context)
  • 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-07T16:59:17+00:00Added an answer on June 7, 2026 at 4:59 pm

    You are looking for the null-master fallback trick. Since request is available in the Jinja2 context, if you are using a library that sets the appropriate header you can simply do this:

    {% if not request.is_xhr %}{% extends "base.html" %}{% endif -%}
    {% load i18n %}
    {% block content %}
    
      <div class="itemBg">
        <div class="itemTop">
          <div class="itemDown">
    
            <div class="rowContainer">
                <div class="show att">
                    {{ msg }}
                </div>
            </div>
    
    </div></div></div>
    {% endblock %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in mako template, i use this ${request.environ['repoze.who.identity']['user']} and the render in controller: render('file.html') can
How can I render only a specific BLOCK in a template? Suppose I have
I have a console application from which I create a window. I can render
In JSP, I notice that I can't render ${} into HTML. After the page
in a partial view I have the following: <%Html.RenderAction(MVC.User.GetComments(Model.UserGroupName)); %> can I render a
Currently I have a view which I render to a template and return it
How can I force complete re-render of a template with knockout.js 1.3.0 beta I
I'm trying to build a simple User Template system so that my users can
For rendering form errors in a twig template, you just have to use the
I want to render some json data using HTML template. I haven't started implementing

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.