Skip to content
Browse files

proper datetime formatting

  • Loading branch information...
1 parent 59d4b19 commit 76a64f261c5c0161d1d52914f69af01363ffed3a @washort washort committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 scripts/
10 scripts/
@@ -11,12 +11,12 @@
--noauth_local_webserver as well.)
Paste the printed credentials into the Django settings file.
+import json
import pprint
import sys
import gflags
-from oauth2client.client import flow_from_clientsecrets, Storage
+from oauth2client.client import flow_from_clientsecrets, Storage, EXPIRY_FORMAT
from import run
gflags.DEFINE_string('secrets', None, 'Client secret JSON filename', short_name='f')
@@ -38,9 +38,11 @@
s.put = lambda *a, **kw: None
credentials = run(FLOW, s)
-bits = dict([(name, getattr(credentials, name)) for name in
+bits = dict([(str(name), str(getattr(credentials, name))) for name in
('access_token', 'client_id', 'client_secret',
- 'refresh_token', 'token_expiry', 'token_uri',
+ 'refresh_token', 'token_uri',
+bits['token_expiry'] = credentials.token_expiry.strftime(EXPIRY_FORMAT)

0 comments on commit 76a64f2

Please sign in to comment.
Something went wrong with that request. Please try again.