An open API service indexing awesome lists of open source software.

https://github.com/bessouat40/django-react-integration


https://github.com/bessouat40/django-react-integration

beginner-friendly beginner-project django django-react-integration python reactjs tutorial

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# Use react components in a Django site

## Installation

You first need to create your Django site and your react app inside it :

```bash
django-admin startproject django_react
cd django_react
npx create-react-app react-app
```

### Build react app

Now you need to build your react app to generate static files :

```bash
cd react-app
npm run build
```

### Run your Django server

You're ready to start your Django site :

```bash
cd ..
python manage.py runserver
```

## React app modification

Every time you change your react app code, you need to generate your new static files.
Go inside your react app folder and remove your build folder.

```bash
npm run build
```

## Ressource

YOUTUBE video : `https://www.youtube.com/watch?v=FhkqMHxchZ8`