Quickstart
Steps To Follow
a real quick starter !!
- Add the app name -
django_gauth
in INSTALLED_APPS entry of you project- in your django project's settings.py file :
-
Add required configuration variables
- in your django project's root ( location :
project-name/project-name/
) : - explainantion :
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
directs the server to accept in-secure ( http ) connections .
- in your django project's root ( location :
-
configure auth urls
- in your django project's root ( location :
project-name/project-name/
) :
- in your django project's root ( location :
-
Now run the application server :
-
we have shown port 8000 in use, you can replace any port number of your choice in place of 8000 . ( e.g : 5000, 8080 etc ... )
-
Important Points
- useually all servers ( wsgi, asgi, uWsgi) runs default on
http://127.0.0.1:PORT/
, hence always take care to set the redirect endpoints in your google oauth2 client app in accordance with 127.0.0.1 , don't mistake to consider - localhost , 0.0.0.0 and 127.0.0.1 as same while dealing with redirect uri's .- For example : suppose you have set
http://localhost:PORT/gauth/google-callback
as your redirect uri , then take note of running your django app on localhost only !!
- For example : suppose you have set