API seems to work ok
This commit is contained in:
@@ -85,9 +85,9 @@ def get_token(code):
|
||||
client_auth = requests.auth.HTTPBasicAuth(TEST_CLIENT_ID, TEST_CLIENT_SECRET)
|
||||
post_data = {"grant_type": "authorization_code",
|
||||
"code": code,
|
||||
"redirect_uri": TEST_REDIRECT_URI,
|
||||
"client_secret": TEST_CLIENT_SECRET,
|
||||
"client_id":TEST_CLIENT_ID,
|
||||
"redirect_uri": "http://localhost:8000/rowers/test_callback",
|
||||
"client_secret": "aapnootmies",
|
||||
"client_id":1,
|
||||
}
|
||||
headers = {'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'}
|
||||
@@ -99,12 +99,12 @@ def get_token(code):
|
||||
data=json.dumps(post_data),
|
||||
headers=headers)
|
||||
|
||||
print response.text
|
||||
token_json = response.json()
|
||||
thetoken = token_json['access_token']
|
||||
expires_in = token_json['expires_in']
|
||||
refresh_token = token_json['refresh_token']
|
||||
|
||||
|
||||
return [thetoken,expires_in,refresh_token]
|
||||
|
||||
def make_authorization_url(request):
|
||||
|
||||
@@ -105,7 +105,7 @@ from interactiveplots import *
|
||||
|
||||
schema_view = get_swagger_view(title='Rowsandall API (Unstable)')
|
||||
|
||||
|
||||
|
||||
|
||||
def error500_view(request):
|
||||
response = render_to_response('500.html', {},
|
||||
@@ -4830,7 +4830,7 @@ def strokedatajson(request,id):
|
||||
|
||||
|
||||
if request.method == 'GET':
|
||||
columns = ['spm','timesecs','hr','pseconds','power','distance']
|
||||
columns = ['spm','time','hr','pace','power','distance']
|
||||
datadf = dataprep.getsmallrowdata_db(columns,ids=[id])
|
||||
return JSONResponse(datadf)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user