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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1ODA5MjYsIm5iZiI6MTcyMjU4MDYyNiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzMDYtMWNiYWRiMmQtNTk0Yi00MzNjLTlmODItZjY2ZjM0ZWMyZTNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA2MzcwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwMTc0N2E0NzAxMjlmOGFmYmM5YmNjNTVjZTQ2MTg2MWI1ZDJkMjM5YWY1Y2VlOGY5N2I4ODExYWMzZWVhOGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.f0mdocfDPUa9ZYg-EcQ-f78uuUtl0X0eBsVKQ-b4KwA)
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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1ODA5MjYsIm5iZiI6MTcyMjU4MDYyNiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzMzktZGEyN2YzNjMtNmRhOC00ZTU2LWE3ODctODAxMzYxMTYwOWMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA2MzcwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhNjI3NmMxZDJmODI4MjcwNGFjMWVhNGU5NzM2Mjc3ZDhkZmE1ODM0NzhmY2FhMWFmODkzMzdhNWMxZTU3OTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bLxajhrTMQPRVEDwR4ZmR-ee7LeQEILU1ij0XNSFJFE)
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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI1ODA5MjYsIm5iZiI6MTcyMjU4MDYyNiwicGF0aCI6Ii84OTgyNzkzMS8yNzE3NjUzNjQtMjVhMzk1NzMtMzc3Yy00MTczLWFmZjEtN2NjOTNlZTU1NDg0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAyVDA2MzcwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4NTk0ZDc2NGE3ZmRhMjZmZDc0MWE3NzdiYjM1NTljMWU1MzJmYWMxYzQ3NDBjNTMzMmNmZTU3YTA5MzRjOGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.odbJM_rb5ZmdkcnmhFYj78IBHoZtqR3pl2PPvwibkjc)
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.