Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diogosouza/django-react-logrocket
A simple integration between Django API and React App
https://github.com/diogosouza/django-react-logrocket
django django-api integration javascript logrocket python react reactjs
Last synced: 12 days ago
JSON representation
A simple integration between Django API and React App
- Host: GitHub
- URL: https://github.com/diogosouza/django-react-logrocket
- Owner: diogosouza
- Created: 2019-12-01T14:46:17.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T08:57:52.000Z (10 months ago)
- Last Synced: 2024-12-13T05:36:54.296Z (19 days ago)
- Topics: django, django-api, integration, javascript, logrocket, python, react, reactjs
- Language: JavaScript
- Homepage:
- Size: 4.01 MB
- Stars: 104
- Watchers: 7
- Forks: 51
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React App + Django API
A simple integration between a Django API and a React App as a result of my article: [Creating an app with React and Django](https://blog.logrocket.com/creating-an-app-with-react-and-django/).
This project consists of two internal projects:
- *students*: the Django project containing the REST API along with all the backend code;
- *students-fe*: the React project with all the Node dependencies, settings and things related to the frontend.## Run it locally
In order to run the projects locally you need to have Node, npm and `python3` installed on your machine.
### Running the Django project
First, create a Python virtual environment to isolate the projects:
```bash
python3 -m venv logrocket_env
```Then, activate it:
```bash
source logrocket_env/bin/activate
````cd` into the _venv_ and clone the project from GitHub:
```bash
git clone https://github.com/diogosouza/django-react-logrocket.git
```Add the Django dependencies:
```bash
pip install django djangorestframework django-cors-headers
```Finally, `cd` into the _django-react-logrocket_ folder and run the project:
```bash
python manage.py runserver
```That's it!
Access the address http://localhost:8000/api/students/ and check if the API is up.
### Running the React project
First, `cd` the _students-fe_ directory and run:
```bash
npm install
npm start
```