render
Return an HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments.
def render(
request: HttpRequest,
template_name: str|list,
context: dict,
content_type: str,
status: int,
using: str
) - > HttpResponse
Return an HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments.
Parameters
| Name | Type | Description |
|---|---|---|
| request | HttpRequest | The request object used to generate this response, which is passed to the template engine to provide context like CSRF tokens. |
| template_name | `str | list` |
| context | dict | A dictionary of values to add to the template context; defaults to an empty dictionary if not provided. |
| content_type | str | The MIME type to use for the resulting document, such as "text/html". |
| status | int | The HTTP status code for the response, such as 200 or 404. |
| using | str | The name of a template engine to use for loading the template. |
Returns
| Type | Description |
|---|---|
HttpResponse | An HttpResponse instance containing the rendered template content with the specified status and content type. |