# How can I render multiple views in one template

**URL:** <https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915>\
**Category:** Templates & Frontend\
**Created:** [September 10, 2022, 1:52pm UTC](https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915 "2022-09-10T13:52:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![khaldon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/khaldon/32/1211_2.png) [@khaldon](https://forum.djangoproject.com/u/khaldon)\
**Post date:** [September 10, 2022, 1:52pm UTC](https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915/1 "2022-09-10T13:52:42Z")

</div>

I have already frontend template I need to convert it to backend everything works fine but in home page I need has different sections need to render using views in django but how can I do that in one template called `home.html` I rendered home page fine when I go to next section like newsletter section to client add his email address and click on the button how can I handle that?? also if I have another sections like some simple posts how show them also I use for each section template and I use `include ` template tag for all sections

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 10, 2022, 1:57pm UTC](https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915/2 "2022-09-10T13:57:55Z")

</div>

You’re looking at it backwards.

A template does not render a view.

A view renders a template.

Your view can call other functions to retrieve data to add to the context, and then render the template with the data provided by those other functions.

---

<div class="post-metadata">

**Author:** ![khaldon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/khaldon/32/1211_2.png) [@khaldon](https://forum.djangoproject.com/u/khaldon)\
**Post date:** [September 10, 2022, 2:45pm UTC](https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915/3 "2022-09-10T14:45:18Z")

</div>

so I have 3 class based view instantiate from `ListView`, `CreateView` , ` FormView` I want to use them in one template such as `home.html` but it doesn’t work with me so what is the solution?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 10, 2022, 3:58pm UTC](https://forum.djangoproject.com/t/how-can-i-render-multiple-views-in-one-template/15915/4 "2022-09-10T15:58:02Z")

</div>

- Be aware of _how_ Django processes requests to return results. Always think about the flow of events in your system.

- Keep in mind that the Django-provided class-based views are not the “be-all” / “end-all” way to render responses.

You’ll want to rethink the structure of your view. You’ll want to write a view that collects all the data needed for your template, puts that data into a context, then renders that template with the collected data.

The Django-provided generic CBVs may not be the best option for you here.

> [@khaldon](#):
>
> I want to use them in one template such as `home.html`

You’re still phrasing this backwards. A template does not use a view. Templates don’t _do_ anything. Templates are text used _by_ views to (usually) create HTML to be sent do the browser.
