https://github.com/devmahmud/django_react_social_login
Social login(Facebook, Google) demonstration in Django Rest Framework & React JS
https://github.com/devmahmud/django_react_social_login
django-react-social-login django-rest-auth django-rest-social-auth django-social-auth react-social-login
Last synced: 5 months ago
JSON representation
Social login(Facebook, Google) demonstration in Django Rest Framework & React JS
- Host: GitHub
- URL: https://github.com/devmahmud/django_react_social_login
- Owner: devmahmud
- Created: 2022-04-03T17:38:43.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-15T18:16:21.000Z (almost 3 years ago)
- Last Synced: 2025-05-07T05:40:58.263Z (9 months ago)
- Topics: django-react-social-login, django-rest-auth, django-rest-social-auth, django-social-auth, react-social-login
- Language: Python
- Homepage:
- Size: 846 KB
- Stars: 16
- Watchers: 1
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django React Social Login
This web-application demonstrates social authentication (Google, Facebook OAuth as an example) with Django Rest Framework and React.
## Installation
Change the directory to core, setup & activate virtual environment:
```bash
cd core
python3 -m venv venv
source venv/bin/activate
```
Install the backend server dependency:
```bash
pip install -r requirements.txt
```
Make migrations & Migrate the db:
```bash
python manage.py makemigrations
python manage.py migrate
```
Create a superuser:
```bash
python manage.py createsuperuser
```
Run the server & login to http://127.0.0.1:8000/admin :
```bash
python manage.py runserver
```
Change/add the domain from SITES then add social application under SOCIAL_ACCOUNTS. You can obtain CLIENT_ID and SECRET_KEY for Google from [https://console.developers.google.com](https://console.developers.google.com) and for Facebook [https://developers.facebook.com/](https://developers.facebook.com/)
### Now it's time to setup the frontend
Change the terminal directory to frontend:
```bash
cd frontend
```
Change the **appId** & **clientId** in src/App.js
Install the frontend app dependency & run the application:
```bash
yarn install
yarn start
```
Now you should see two login buttons one for Google login & another for Facebook.