# Django Frontend

**URL:** <https://forum.djangoproject.com/t/django-frontend/20377>\
**Category:** Getting Started\
**Created:** [April 19, 2023, 5:16pm UTC](https://forum.djangoproject.com/t/django-frontend/20377 "2023-04-19T17:16:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucas-tolotosilva](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/lucas-tolotosilva/32/13328_2.png) [@lucas-tolotosilva](https://forum.djangoproject.com/u/lucas-tolotosilva)\
**Post date:** [April 19, 2023, 5:16pm UTC](https://forum.djangoproject.com/t/django-frontend/20377/1 "2023-04-19T17:16:37Z")

</div>

How Can I use Django and React??

---

<div class="post-metadata">

**Author:** ![czue](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/czue/32/1387_2.png) [@czue](https://forum.djangoproject.com/u/czue)\
**Post date:** [April 21, 2023, 8:07am UTC](https://forum.djangoproject.com/t/django-frontend/20377/2 "2023-04-21T08:07:12Z")

</div>

Copying my answer from [stack overflow](https://stackoverflow.com/a/65034962/8207) here:

You have two primary architecture options:

1. A completely decoupled client/server approach using something like [create-react-app](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) and [Django REST Framework](https://www.django-rest-framework.org/)
2. A hybrid architecture where you set up a React build pipeline (likely using [webpack](https://webpack.js.org/)) and then include the compiled files as static files in your Django templates.

These might look something like this:

Option 1 (Client/Server Architecture):

[![Client / Server Architecture](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/1/149493c6f7fc9d205ebf6bc14cba58a419043497.png)](https://i.stack.imgur.com/Sq1hr.png)

Option 2 (Hybrid Architecture):

[![Hybrid Architecture](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/6/6edfa7d875f6d5581545786b6d3a4cb8ed0cce6e.png)](https://i.stack.imgur.com/RKKEa.png)

The decision between these two will depend on your / your team’s experience, as well as the complexity of your UI. The first option is good if you have a lot of JS experience, want to keep your front-end / back-end developers separate, or want to write _your entire application as a React single-page-app_. The second option is generally better if you are more familiar with Django and _want to move quickly while also using React for some parts of your app_. I find it’s a particularly good fit for full-stack solo-developers.

There is a lot more information in the series “[Modern JavaScript for Django Developers](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/)”, including [choosing your architecture](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/client-server-architectures/), [integrating your JS build into a Django project](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/integrating-javascript-pipeline/) and [building a single-page React app](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/integrating-django-react/).

Full disclosure, I’m the author of that series.
