This peoject is purely based on django which is python web framework.
- Clone the code
- Write command
pip install pipenv
to create virtual env and install packages form pipfile - After installing
pipenv
wte commandpipenv install
This command will create virtual env and install all packages automatically. - Write command
pipenv shell
to start the virtual env - Write command
python manage.py migrate
to migrate the database - Write command
python manage.py createsuperuser
to create superuser - Write command
python manage.py collactstatic
to run the server - Write command
python manage.py runserver
to start the server
- Install all tha backages using command
pip install -r requirements.txt
- Now you need to install POSTGRESQL for databse and create your data base and give your password
- After setup like above snapshot you need to run command
python manage.py migrate
- Go to https://developers.facebook.com/
- Clock on get started
- Create a new app
- Go to products and select facebook login set up
- Click on web
- Enter the url of the server like this
http://localhost:8000/
because facebook will not recignize127.0.0.1
as a valid url - Click on save
- Got to
Settings
andBasic
tab copy theApp ID
andApp Secret
- Go to
http://localhost:8000/admin/
and login with superuser credentials - In admin panel go to
Social Account
and add a newSocial application
- In place of
Provider
selectFacebook
andName
writeFacebook login
- In
Client id
write theApp ID
that we copied from facebook - In
Secret
write theSecret key
that we copied from facebook - from sits in available tab you will see example.com just shift it to right side and save it
- After saving you will see go to admin home and you will se site option go there and click in
example.com
there change Domain tolocalhost:8000
and Display name tolocalhost:8000
and save it
- Go to admin panel and add a
social application
- In place of
Provider
selectGoogle
- In
Client id
write theClient ID
that we copied from google - In
Secret
write theSecret key
that we copied from google
- In place of
- Go to https://console.developers.google.com/ and login with google account
- Create a new project
- In
Project name
writeCarzone Login
and click on create
- In
- Go to
OAuth consent screen
and selectExternal
and click onCreate
- In Accplication name write
Carzone Project
- And scroll down and clock on save and contiune
- In Accplication name write
- Go to
Credentials
and selectCreate credentials
- select
OAuth consent screen
- Application type is
Web application
- Name is
Carzone
- Authorized JavaScript origins is
http://localhost:8000
and click add url and writehttp://127.0.0.1:8000
- Authorized redirect URIs is
http://localhost/socialaccounts/google/login/callback
and click add uris and writehttp://127.0.0.1:8000/socialaccounts/google/login/callback
- finally click on
Create
- After you will get yout
Client ID
andClient secret
- Application type is
- Copy and paste
Client ID
andClient secret
to admin panel - Move localhost:8000 to right side and save it