[Answer]-How Django TemplateResponse handle multi templates

2👍

It should behave the same way as render_to_string(), which is: choose the first that exists.

👤lqc

-1👍

TemplateResponse objects retain the details of the template and context that was provided by the view to compute the response. So its controlled by View.

You can also override this method SimpleTemplateResponse.resolve_template(template) to customize the template rendering

Ref:
https://docs.djangoproject.com/en/dev/ref/template-response/

Leave a comment