-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
email-based user model and google auth #2
Conversation
|
||
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies' | ||
SESSION_COOKIE_AGE = 60 * 60 * 24 * 31 | ||
SECRET_KEY = 'Oh my god I love cake so much holy shit how amazing is cake; like, seriously?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
|
||
data = json.dumps(client_secrets) | ||
|
||
text_file = open("client_secrets.json", "w") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should create the file if it doesn't already exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get migrate
to work, I had to paste in the web
object and all its keys (with empty strings) to a manually generated client_secrets.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, this is due to the "global" Flow
object in the user model - it kicks in simply by loading up the code so it might be worth turning that into something that has a def getFlowObject(): ...
that creates it if Flow
is None
and otherwise just does a passthrough, so there's nothing that breaks when client_secrets.json doesn't exist yet...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this rigamarole of env var -> JSON because of the way Heroku works, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not strictly heroku, but yes: we don't want to check in a client_secrets.json, and the auth library does not read in values from env, so we need a little script that can generate the file the library wants, based on variables in the active environment
(why their lib can't just read in "either from file or from env", I do not know... )
some oddities in this PR due to what manage.py decided to do: the "default inserts" should probably be in a place that doesn't get blasted away when you regenerated migrations "from scratch" because it looks like this branch did exactly that thing...
This definitely needs your eyes @alanmoo, before we merge this in.