Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

According to the relevant Django documentation, a request context offers more than a normal context in that it merges request data into the context.

It is hence necessary for views that perform form submission in Django.

However, I am wondering why one cannot just always pass a request context for every view. After all, a request context offers more than a normal context.

Why not create a helper function called, say, render() that automatically passes a request context? Is there a performance disadvantage?

share|improve this question
    
django.shortcuts.render is an easy way to use RequestContext. –  Colin Dunklau Feb 18 '13 at 1:56

1 Answer 1

up vote 6 down vote accepted

There is a performance disadvantage. It should be faster to render a template with an small context than with big context (i.e. the request context).

share|improve this answer
1  
Can you elaborate a little more on your answer? –  user8 Jan 20 '12 at 20:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.