Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render">https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render</a></p> <pre><code>render(request, template[, dictionary][, context_instance][, content_type][, status][, current_app]) </code></pre> <p><code>render()</code> is a brand spanking new shortcut for <code>render_to_response</code> in 1.3 that will automatically use <code>RequestContext</code> that I will most definitely be using from now on.</p> <hr> <p><a href="https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render-to-response">https://docs.djangoproject.com/en/1.8/topics/http/shortcuts/#render-to-response</a></p> <pre><code>render_to_response(template[, dictionary][, context_instance][, mimetype])¶ </code></pre> <p><code>render_to_response</code> is your standard render function used in the tutorials and such. To use <code>RequestContext</code> you'd have to specify <code>context_instance=RequestContext(request)</code></p> <hr> <p><a href="https://docs.djangoproject.com/en/1.8/ref/generic-views/#django-views-generic-simple-direct-to-template">https://docs.djangoproject.com/en/1.8/ref/generic-views/#django-views-generic-simple-direct-to-template</a></p> <p><code>direct_to_template</code> is a generic view that I use in my views (as opposed to in my urls) because like the new <code>render()</code> function, it automatically uses <code>RequestContext</code> and all its <code>context_processor</code>s.</p> <p>But <code>direct_to_template</code> <em>should be avoided</em> as function based generic views are deprecated. Either use <code>render</code> or an actual class, see <a href="https://docs.djangoproject.com/en/1.3/topics/generic-views-migration/">https://docs.djangoproject.com/en/1.3/topics/generic-views-migration/</a></p> <p>I'm happy I haven't typed <code>RequestContext</code> in a long, long time. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload