0

From the documentation:

render

Combines a given template with a given context dictionary and returns an HttpResponse object with that rendered text.

render() is the same as a call to render_to_response() with a context_instance argument that forces the use of a RequestContext.

render_to_response

Renders a given template with a given context dictionary and returns an HttpResponse object with that rendered text.

Can you provide a task-oriented example and a description of when one would choose to use render_to_response in a view versus render?

Community
  • 1
  • 1
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
  • 1
    http://stackoverflow.com/questions/5154358/django-what-is-the-difference-between-render-render-to-response-and-direc – Ted Mar 28 '13 at 22:08

1 Answers1

-1

Well the only difference is that with render_to_response you could pass in a different context dictionary to view (template). By default RequestContext will build up a "context" via the Django's middleware functions defined in your settings file TEMPLATE_CONTEXT_PROCESSORS.

Tom
  • 1,986
  • 2
  • 18
  • 29