A simple task manager based on Python/Django
How to run the google login part
In order to add the google login feature, you need to follow the instructions below
- You’ll need to set up OAuth application via Google Developers Console
- Go to Dashboard, create a NEW PROJECT
- Name your new project, preferably your website or app name. User will be able to see this project name when we redirect them to Google login page.
- Click “CREATE” to proceed.
- Back to “Dashboard”, go to “Credentials” on left panel.
- Create credentials. On the dropdown, choose “OAuth Client ID” option.
- Make sure you fill out the “OAuth Consent Screen” form.
- You’ll only need to provide “Application name”, “Email” and click “SAVE”.
- Now, you can create your OAuth Client ID by filling out these details;
- Authorized Javascript origins (http://127.0.0.1:8000)
- Authorized redirect URL (http://127.0.0.1:8000/accounts/google/login/callback/)
- Once you click “CREATE”, you will be able to obtain your “client ID” and “client Secret”.
- You’ll need this information to proceed the next steps
Django admin
-
$ python manage.py createsuperuser
-
$ python manage.py runserver
-
On the SITES section, click “sites” and fill out the details and click “Save”
-
Domain name: 127.0.0.1:8000 Display name: 127.0.0.1:8000
Add social applications
- Provider: Google Name: Google API Client id: (refer step 7, your OAuth details) Secret key: (refer step 7, your OAuth details)
See the result
You’re almost done! Now navigate to (http://127.0.0.1:8000/) to see the “Sign in with Google” page.