Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.29 KB

README.md

File metadata and controls

59 lines (39 loc) · 1.29 KB

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:

cd core
python3 -m venv venv
source venv/bin/activate

Install the backend server dependency:

pip install -r requirements.txt

Make migrations & Migrate the db:

python manage.py makemigrations
python manage.py migrate

Create a superuser:

python manage.py createsuperuser

Run the server & login to http://127.0.0.1:8000/admin :

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 and for Facebook https://developers.facebook.com/

Now it's time to setup the frontend

Change the terminal directory to frontend:

cd frontend

Change the appId & clientId in src/App.js

Install the frontend app dependency & run the application:

yarn install
yarn start

Now you should see two login buttons one for Google login & another for Facebook.