This project demonstrates the integration of Django as a backend and React as a frontend to create a simple web application. The application allows users to input their name and email, which is then displayed both in the Django Rest Framework and on the React frontend.
![image](https://private-user-images.githubusercontent.com/89827931/271765306-1cbadb2d-594b-433c-9f82-f66f34ec2e3f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTM5OTYsIm5iZiI6MTczOTU5MzY5NiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzMDYtMWNiYWRiMmQtNTk0Yi00MzNjLTlmODItZjY2ZjM0ZWMyZTNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MjgxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZiYjY2ZGFmYmVhOTU5NWI5MzE0ZjVhM2ZiMjQwNzIwODk0Njg1NzA3YmU4ZmIwMDRkYmU5MTc3NTUyZDE2YWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JYTKCPIEJKQegGgska4zkQTpZPi7pECW4dOAu8eDYFg)
Description: This screenshot shows the Django backend where user data input .
![image](https://private-user-images.githubusercontent.com/89827931/271765339-da27f363-6da8-4e56-a787-8013611609c0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTM5OTYsIm5iZiI6MTczOTU5MzY5NiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzMzktZGEyN2YzNjMtNmRhOC00ZTU2LWE3ODctODAxMzYxMTYwOWMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MjgxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiNjIwYzg5MTEwNTAzMmE3ZGUyMTEzMjZlOGQ4YThiYmEzZTZlNzhjNDg4ZTY3M2EyYmZkZTFjOWVhOGU2ZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.43jlA_S7Bs_euHX70FCuDfHXOKYKf4DPexO_LUitxqY)
Description: This screenshot shows the Django API app named api
located inside the djangobackend
folder.
![image](https://private-user-images.githubusercontent.com/89827931/271765364-25a39573-377c-4173-aff1-7cc93ee55484.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTM5OTYsIm5iZiI6MTczOTU5MzY5NiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzNjQtMjVhMzk1NzMtMzc3Yy00MTczLWFmZjEtN2NjOTNlZTU1NDg0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MjgxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYyYzg3ZWJjOTZiZWIyZjQ4ZmQxNmM5ZjBhNzFlZjM5NDVmM2FiNmU4NjJlNGZhYzZmNzNmMjJmMWM0NTM4ODImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.DmuRQXXdNI6f6Whhev5KsY9b3aK9ODIiSx1EYjkUtbU)
Description: This screenshot displays the React frontend where user data is displayed.
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your system.
- Python and Django installed on your system.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/django-react-integration.git
-
Change into the project directory:
cd django-react-integration
-
Set up the Django backend:
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install Django and other dependencies:
pip install -r requirements.txt
-
Apply migrations and run the Django server:
python manage.py migrate python manage.py runserver
The Django API should now be accessible at http://localhost:8000/api/student/.
-
-
Set up the React frontend:
-
Change into the
frontend
directory:cd frontend
-
Install frontend dependencies:
npm install
-
Start the React development server:
npm start
The React frontend should now be accessible at http://localhost:3000/.
-
-
Access the React frontend at http://localhost:3000/.
-
Enter your name and email in the form on the homepage and click "Submit."
-
The data you entered will be displayed on the same page.
-
To view the data in the Django Rest Framework, visit http://localhost:8000/api/student/ in your browser or use an API client like Postman.
This project is licensed under the MIT License - see the LICENSE file for details.