-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at Google login - functional tested
- Loading branch information
Marcus Mann
committed
Mar 9, 2022
1 parent
b5fc279
commit 147f677
Showing
8 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# group-project-a-07 | ||
# Word Of Mouth | ||
|
||
|
||
## How to start developing: | ||
1. Create a [GCP App](https://console.cloud.google.com/home/) | ||
2. Go to [API Overview](https://console.cloud.google.com/apis/) | ||
3. Go to "Credentials" on the menu to the left | ||
4. Hit Create Credentials at the top of the page | ||
1. For the "Approved JavaScript Origins", set it to be `http://localhost:8000`. (TODO: We need to add our heroku deployments to this list) | ||
2. For the "Authorized Redirect URLs", set it to be `http://localhost:8000/accounts/google/login/callback/`. (TODO: See above) | ||
3. (side note: if you are running into errors, keep in mind that `localhost` and `127.0.0.1` are two different domain names, even though they resolve to the same place) | ||
5. Run migrations: `python manage.py migrate` | ||
6. Create superuser: `python manage.py createsuperuser` | ||
7. Go to `localhost:8000/admin`, go to "Social Applications", and add the application with the "Client ID" and "Secret Key" that we got from our GCP console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
from django.db.models import Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% load account %} | ||
{% load i18n %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Google Registration</title> | ||
</head> | ||
<body> | ||
{% load socialaccount %} | ||
<h1>My Google Login Project</h1> | ||
<a href="{% provider_login_url 'google' %}?next=/">Login with Google</a> | ||
|
||
{% if user.is_authenticated %} | ||
<p> | ||
{% user_display user as user_display %} | ||
{% blocktrans %}{{ user_display }} has logged in...{% endblocktrans %} | ||
</p> | ||
{% else %} | ||
<p>User is not logged in</p> | ||
|
||
{% endif %} | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
django-allauth | ||
|
||
Django | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters