InterviewSolution
| 1. |
What is django.shortcuts.render function? |
|
Answer» When a view function returns a webpage as HttpResponse instead of a simple string, we use render(). Render function is a shortcut function that lets the developer easily pass the data dictionary with the template. This function then combines the template with a data dictionary via templating engine. FINALLY, this render() returns as HttpResponse with the rendered text, which is the data returned by MODELS. Thus, Django render() bypasses most of the developer’s work and lets him use different template engines. |
|