Google-auth is an easy to setup google authentication/registration mechanism with support for the Django Framework
-
Installation:
pip install git+https://github.com/technoarch-softwares/google-auth -
Add
"google_login"to yourINSTALLED_APPSsetting like this::INSTALLED_APPS = (
... 'google_login',)
-
Add this lines to your project settings file:
`SITE_URL = 'SITE DOMIAN' #like 'http://localhost:8000/'`
`ERROR_REDIRECT_URL = 'SITE LOGIN URL'`
`GOOGLE_REDIRECT_URL = 'google/authentication'`
-
Add Google Secret Keys and Client Id
GOOGLE_CLIENT_ID = 'GOOGLE API KEY'GOOGLE_CLIENT_SECRET = 'GOOGLE API SECRET' -
Include the google_login URLconf in your project urls.py like this::
url(r'^google/', include('google_login.urls')), -
Run
python manage.py migrateto create thegoogle_loginmodels. -
It will create a table into database named by
google_login_googleprofile. -
Visit http://127.0.0.1:8000/google/ to participate in the google authentication.
#Features
-
Access the Google API, from Your website (Using OAuth)
-
Django User Registration (Convert Google user data into a user model)
-
Store user data locally.
-
Google GQL access
-
Automated reauthentication (For expired tokens)