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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:44:17+00:00 2026-06-15T23:44:17+00:00

I sometimes access the context by supplying ‘takes_context=True’ for Django tags; Usually to acess

  • 0

I sometimes access the context by supplying ‘takes_context=True’ for Django tags; Usually to acess the request.

But are there performance implications.

My mental model of how templates worke is that the tag function assembles the nodes representing the template, and that thereafter these nodes can render content without recreating the node, or reparsing the template.

But surely, if the tag function can be made to return different nodes, depending on
Something in the context, then the nodes will have to be recreated everytime the context is different (I.E every time).

Either that, or you are stuck with what nodes you get first time round, in which case you shouldn’t return nodes based on anything in the context (in which case, what’s the point?).

Can someone clear this up for me? I’ using Django 1.4.2.

  • 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-15T23:44:17+00:00Added an answer on June 15, 2026 at 11:44 pm

    Nodes are created when a template is loaded. When it’s rendered, context is simply passed to the Node’s render method. The only difference simple_tag‘s takes_context argument makes is making the resulting Node.render code pass context along to your function. So no, there are no performance implications to using takes_context.

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

Sidebar

Related Questions

Very simple thing. I sometimes want to access urban dictionary but it is blocked
Sometimes in my OpenGL application I get an access violation in the following API
Sometimes i face the following problem : string txt = con.Request.Params[Par_name].ToString();//the original par value
Ok, I am an experienced web developer but sometimes ASP.Net is tricking me. I
I sometimes access a hash like this: if(exists $ids{$name}){ $id = $ids{$name}; } Is
This code works some of the time, but then sometimes crashes with a EXC_BAD_ACCESS
First, check out my fiddle fiddle jsFiddle is nice, but sometimes it runs a
Context: Many of the operations I'm doing require lengthy web accesses. Sometimes a web
Sometimes you come by Zip files with file or directory with some unrecognized characters
Sometimes I feel the urge to put some more expressiveness in my git commit

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.