# DRF and Django templates

**URL:** <https://forum.djangoproject.com/t/drf-and-django-templates/31304>\
**Category:** Templates & Frontend\
**Created:** [May 19, 2024, 6:55am UTC](https://forum.djangoproject.com/t/drf-and-django-templates/31304 "2024-05-19T06:55:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oulaKhaled](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@oulaKhaled](https://forum.djangoproject.com/u/oulaKhaled)\
**Post date:** [May 19, 2024, 6:55am UTC](https://forum.djangoproject.com/t/drf-and-django-templates/31304/1 "2024-05-19T06:55:21Z")

</div>

I ma trying to build a DRF in Django and use Django templates for frontend…  
my question is, should I create tow separate apps in my project to do it…  
or should I just create a single app that can do both…  
should I create `ViewSet` to provide actions and view for fetch and send data to template in the same app?  
also ,I am wondering if even using Django template for frontend is a good idea…,or should I use a separate frontend framework?

---

<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:** [May 19, 2024, 2:26pm UTC](https://forum.djangoproject.com/t/drf-and-django-templates/31304/2 "2024-05-19T14:26:46Z")

</div>

> [@oulaKhaled](#):
>
> should I create tow separate apps in my project to do it…

You can find a few discussions here that talk about whether you should create one app or many.  
See

- [Why do we need apps?](https://forum.djangoproject.com/t/why-do-we-need-apps/827)
- [Project organization- when is something a separate app?](https://forum.djangoproject.com/t/project-organization-when-is-something-a-separate-app/1247)
- [Two separate Django apps require the same models](https://forum.djangoproject.com/t/two-separate-django-apps-require-the-same-models/22069)

for some perspectives on this.

However, I’m curious as to why you’re trying to build it this way. For the most part, DRF is intended to produce JSON responses for your custom front-end to consume.

If you’re going to be rendering Django templates, why are you using DRF?

Or, if you’re building this around DRF, what’s the purpose of the Django templates?

---

<div class="post-metadata">

**Author:** ![oulaKhaled](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@oulaKhaled](https://forum.djangoproject.com/u/oulaKhaled)\
**Post date:** [May 19, 2024, 3:06pm UTC](https://forum.djangoproject.com/t/drf-and-django-templates/31304/3 "2024-05-19T15:06:57Z")

</div>

I am trying to build an e-commerce website , and truly I see no point of using a rest api  
, but the prof will give an extra points for using REST API in our project 🙂

---

<div class="post-metadata">

**Author:** ![sitrucp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sitrucp/32/22690_2.png) [@sitrucp](https://forum.djangoproject.com/u/sitrucp)\
**Post date:** [July 18, 2024, 1:51am UTC](https://forum.djangoproject.com/t/drf-and-django-templates/31304/4 "2024-07-18T01:51:16Z")

</div>

Use case is using Django DRF as backend for mobile app and Django templates for web app.
