https://github.com/mikaelengstrom/django-react-polls-example
Example implementation of React in Django
https://github.com/mikaelengstrom/django-react-polls-example
django react server-side-rendering
Last synced: 6 months ago
JSON representation
Example implementation of React in Django
- Host: GitHub
- URL: https://github.com/mikaelengstrom/django-react-polls-example
- Owner: mikaelengstrom
- Created: 2018-06-02T18:40:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T01:50:21.000Z (about 3 years ago)
- Last Synced: 2023-02-26T17:32:04.945Z (about 3 years ago)
- Topics: django, react, server-side-rendering
- Language: JavaScript
- Homepage:
- Size: 1.82 MB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django react polls example
This is an example implementation of a fully React-rendered frontend in Django
It was intended for reference of a Django meetup talk.
You might find the [slides at Slideshare](https://www.slideshare.net/Frojd/integrating-react-in-django-while-staying-sane-and-happy) helpful
# Installation
## Django
1. Clone repo
2. Install python requirements and activate virtualenv with `pipenv sync && pipenv shell`
3. Run migrations and start devserver:
```
cd django_project
./manage.py migrate
./manage.py loaddata data/questions.json
./manage.py runserver
```
## Frontend dev-server
1. run `cd frontend && npm i`
2. run `npm run build` to build javascript assets to django
3. run `npm start` to start the local devserver on :7001
More details of different commands/configuration in frontend/readme.md
# Server Side Rendering (SSR)
... TODO ...