Database Reference
In-Depth Information
day = today + datetime.timedelta(days=delta)
exp = calendar.timegm(
(day + datetime.timedelta(days=15)).replace(
hour=0, minute=0, second=0, microsecond=0)
.utctimetuple()) * 1000
request = bigquery.tables().insert(
projectId=PROJECT_ID,
datasetId='logs',
body={
'tableReference': {
'tableId': day.strftime('device_%Y%m%d')
},
'expirationTime': exp,
'schema': {
'fields': schema
}
})
try:
result = request.execute()
logging.info('Created table ' + result['id'])
except HttpError, e:
if e.resp.status == httplib.CONFLICT:
logging.info('Table for %s exists' % day)
else:
logging.error('Error: ' + str(e))
Authentication
There are three separate types of credentials used in this application:
• The end user's Google credentials
• The application service account's Google credentials
• Application-specific device registration IDs
This section describes how these three credentials related to each other and
in particular how a device is bound to an end user account.
The Manage Devices page of the application is annotated using a Python
decorator, @login_required , to indicate it requires authenticated access.
The user proves their identity by presenting a cookie issued by Google's
Search WWH ::




Custom Search