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
- Host: GitHub
- URL: https://github.com/bessouat40/django-react-integration
- Owner: Bessouat40
- Created: 2023-05-13T17:36:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-17T19:37:40.000Z (about 2 years ago)
- Last Synced: 2025-01-17T01:48:54.126Z (5 months ago)
- Topics: beginner-friendly, beginner-project, django, django-react-integration, python, reactjs, tutorial
- Language: Python
- Homepage:
- Size: 907 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`