improved static url
This commit is contained in:
@@ -2001,18 +2001,18 @@ def interactive_windchart(id=0,promember=0):
|
|||||||
if rowdata == 0:
|
if rowdata == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
dist = rowdata.df.ix[:,'cum_dist']
|
dist = rowdata.df.loc[:,'cum_dist']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vwind = rowdata.df.ix[:,'vwind']
|
vwind = rowdata.df.loc[:,'vwind']
|
||||||
winddirection = rowdata.df.ix[:,'winddirection']
|
winddirection = rowdata.df.loc[:,'winddirection']
|
||||||
bearing = rowdata.df.ix[:,'bearing']
|
bearing = rowdata.df.loc[:,'bearing']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata.add_wind(0,0)
|
rowdata.add_wind(0,0)
|
||||||
rowdata.add_bearing()
|
rowdata.add_bearing()
|
||||||
vwind = rowdata.df.ix[:,'vwind']
|
vwind = rowdata.df.loc[:,'vwind']
|
||||||
winddirection = rowdata.df.ix[:,'winddirection']
|
winddirection = rowdata.df.loc[:,'winddirection']
|
||||||
bearing = rowdata.df.ix[:,'winddirection']
|
bearing = rowdata.df.loc[:,'winddirection']
|
||||||
rowdata.write_csv(f1,gzip=True)
|
rowdata.write_csv(f1,gzip=True)
|
||||||
dataprep.update_strokedata(id,rowdata.df)
|
dataprep.update_strokedata(id,rowdata.df)
|
||||||
|
|
||||||
@@ -2091,13 +2091,13 @@ def interactive_streamchart(id=0,promember=0):
|
|||||||
if rowdata == 0:
|
if rowdata == 0:
|
||||||
return "","No Valid Data Available"
|
return "","No Valid Data Available"
|
||||||
|
|
||||||
dist = rowdata.df.ix[:,'cum_dist']
|
dist = rowdata.df.loc[:,'cum_dist']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vstream = rowdata.df.ix[:,'vstream']
|
vstream = rowdata.df.loc[:,'vstream']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata.add_stream(0)
|
rowdata.add_stream(0)
|
||||||
vstream = rowdata.df.ix[:,'vstream']
|
vstream = rowdata.df.loc[:,'vstream']
|
||||||
rowdata.write_csv(f1,gzip=True)
|
rowdata.write_csv(f1,gzip=True)
|
||||||
dataprep.update_strokedata(id,rowdata.df)
|
dataprep.update_strokedata(id,rowdata.df)
|
||||||
|
|
||||||
@@ -2300,7 +2300,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
|||||||
xaxmax = datadf[xparam].max()
|
xaxmax = datadf[xparam].max()
|
||||||
xaxmin = datadf[xparam].min()
|
xaxmin = datadf[xparam].min()
|
||||||
elif xparam=='time':
|
elif xparam=='time':
|
||||||
tseconds = datadf.ix[:,'time']
|
tseconds = datadf.loc[:,'time']
|
||||||
xaxmax = tseconds.max()
|
xaxmax = tseconds.max()
|
||||||
xaxmin = 0
|
xaxmin = 0
|
||||||
elif xparam == 'workoutid':
|
elif xparam == 'workoutid':
|
||||||
@@ -2314,7 +2314,7 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='',
|
|||||||
yaxmax = datadf[yparam].max()
|
yaxmax = datadf[yparam].max()
|
||||||
yaxmin = datadf[yparam].min()
|
yaxmin = datadf[yparam].min()
|
||||||
elif yparam=='time':
|
elif yparam=='time':
|
||||||
tseconds = datadf.ix[:,'time']
|
tseconds = datadf.loc[:,'time']
|
||||||
yaxmax = tseconds.max()
|
yaxmax = tseconds.max()
|
||||||
yaxmin = 0
|
yaxmin = 0
|
||||||
elif yparam == 'workoutid':
|
elif yparam == 'workoutid':
|
||||||
@@ -2517,7 +2517,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
datadf['x1'] = datadf.ix[:,xparam]
|
datadf['x1'] = datadf.loc[:,xparam]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
try:
|
try:
|
||||||
datadf['x1'] = datadf['distance']
|
datadf['x1'] = datadf['distance']
|
||||||
@@ -2528,7 +2528,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
return ['','<p>No non-zero data in selection</p>','','']
|
return ['','<p>No non-zero data in selection</p>','','']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
datadf['y1'] = datadf.ix[:,yparam1]
|
datadf['y1'] = datadf.loc[:,yparam1]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
try:
|
try:
|
||||||
datadf['y1'] = datadf['pace']
|
datadf['y1'] = datadf['pace']
|
||||||
@@ -2536,7 +2536,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
return ['','<p>No non-zero data in selection</p>','','']
|
return ['','<p>No non-zero data in selection</p>','','']
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
try:
|
try:
|
||||||
datadf['y2'] = datadf.ix[:,yparam2]
|
datadf['y2'] = datadf.loc[:,yparam2]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
datadf['y2'] = datadf['y1']
|
datadf['y2'] = datadf['y1']
|
||||||
else:
|
else:
|
||||||
@@ -2566,7 +2566,7 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
|
|
||||||
if yparam1 == 'pace':
|
if yparam1 == 'pace':
|
||||||
y_axis_type = 'datetime'
|
y_axis_type = 'datetime'
|
||||||
y1mean = datadf.ix[:,'pace'].mean()
|
y1mean = datadf.loc[:,'pace'].mean()
|
||||||
|
|
||||||
datadf['xname'] = axlabels[xparam]
|
datadf['xname'] = axlabels[xparam]
|
||||||
datadf['yname1'] = axlabels[yparam1]
|
datadf['yname1'] = axlabels[yparam1]
|
||||||
@@ -2896,30 +2896,30 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tseconds = rowdata.ix[:,'time']
|
tseconds = rowdata.loc[:,'time']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return '','No time data - cannot make flex plot','','',workstrokesonly
|
return '','No time data - cannot make flex plot','','',workstrokesonly
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rowdata['x1'] = rowdata.ix[:,xparam]
|
rowdata['x1'] = rowdata.loc[:,xparam]
|
||||||
rowmin = rowdata[xparam].min()
|
rowmin = rowdata[xparam].min()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['x1'] = 0*rowdata.ix[:,'time']
|
rowdata['x1'] = 0*rowdata.loc[:,'time']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rowdata['y1'] = rowdata.ix[:,yparam1]
|
rowdata['y1'] = rowdata.loc[:,yparam1]
|
||||||
rowmin = rowdata[yparam1].min()
|
rowmin = rowdata[yparam1].min()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['y1'] = 0*rowdata.ix[:,'time']
|
rowdata['y1'] = 0*rowdata.loc[:,'time']
|
||||||
rowdata[yparam1] = rowdata['y1']
|
rowdata[yparam1] = rowdata['y1']
|
||||||
|
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
try:
|
try:
|
||||||
rowdata['y2'] = rowdata.ix[:,yparam2]
|
rowdata['y2'] = rowdata.loc[:,yparam2]
|
||||||
rowmin = rowdata[yparam2].min()
|
rowmin = rowdata[yparam2].min()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['y2'] = 0*rowdata.ix[:,'time']
|
rowdata['y2'] = 0*rowdata.loc[:,'time']
|
||||||
rowdata[yparam2] = rowdata['y2']
|
rowdata[yparam2] = rowdata['y2']
|
||||||
else:
|
else:
|
||||||
rowdata['y2'] = rowdata['y1']
|
rowdata['y2'] = rowdata['y1']
|
||||||
@@ -2968,7 +2968,7 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
if yparam1 == 'pace':
|
if yparam1 == 'pace':
|
||||||
y_axis_type = 'datetime'
|
y_axis_type = 'datetime'
|
||||||
try:
|
try:
|
||||||
y1mean = rowdata.ix[:,'pace'].mean()
|
y1mean = rowdata.loc[:,'pace'].mean()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
y1mean = 0
|
y1mean = 0
|
||||||
|
|
||||||
@@ -3450,26 +3450,26 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0,
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tseconds = rowdata.ix[:,'time']
|
tseconds = rowdata.loc[:,'time']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return '','No time data - cannot make flex plot'
|
return '','No time data - cannot make flex plot'
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rowdata['x1'] = rowdata.ix[:,xparam]
|
rowdata['x1'] = rowdata.loc[:,xparam]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['x1'] = 0*rowdata.ix[:,'time']
|
rowdata['x1'] = 0*rowdata.loc[:,'time']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rowdata['y1'] = rowdata.ix[:,yparam1]
|
rowdata['y1'] = rowdata.loc[:,yparam1]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['y1'] = 0*rowdata.ix[:,'time']
|
rowdata['y1'] = 0*rowdata.loc[:,'time']
|
||||||
|
|
||||||
if yparam2 != 'None':
|
if yparam2 != 'None':
|
||||||
try:
|
try:
|
||||||
rowdata['y2'] = rowdata.ix[:,yparam2]
|
rowdata['y2'] = rowdata.loc[:,yparam2]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
rowdata['y2'] = 0*rowdata.ix[:,'time']
|
rowdata['y2'] = 0*rowdata.loc[:,'time']
|
||||||
else:
|
else:
|
||||||
rowdata['y2'] = rowdata['y1']
|
rowdata['y2'] = rowdata['y1']
|
||||||
|
|
||||||
@@ -3490,7 +3490,7 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0,
|
|||||||
|
|
||||||
if yparam1 == 'pace':
|
if yparam1 == 'pace':
|
||||||
y_axis_type = 'datetime'
|
y_axis_type = 'datetime'
|
||||||
y1mean = rowdata.ix[:,'pace'].mean()
|
y1mean = rowdata.loc[:,'pace'].mean()
|
||||||
|
|
||||||
|
|
||||||
rowdata['xname'] = axlabels[xparam]
|
rowdata['xname'] = axlabels[xparam]
|
||||||
@@ -3732,9 +3732,9 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
nrworkouts = len(ids)
|
nrworkouts = len(ids)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tseconds = datadf.ix[:,'time']
|
tseconds = datadf.loc[:,'time']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
tseconds = datadf.ix[:,xparam]
|
tseconds = datadf.loc[:,xparam]
|
||||||
|
|
||||||
yparamname = axlabels[yparam]
|
yparamname = axlabels[yparam]
|
||||||
|
|
||||||
@@ -3954,11 +3954,11 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm',
|
|||||||
rowdata2.sort_values(by='time',ascending=True,inplace=True)
|
rowdata2.sort_values(by='time',ascending=True,inplace=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
x1 = rowdata1.ix[:,xparam]
|
x1 = rowdata1.loc[:,xparam]
|
||||||
x2 = rowdata2.ix[:,xparam]
|
x2 = rowdata2.loc[:,xparam]
|
||||||
|
|
||||||
y1 = rowdata1.ix[:,yparam]
|
y1 = rowdata1.loc[:,yparam]
|
||||||
y2 = rowdata2.ix[:,yparam]
|
y2 = rowdata2.loc[:,yparam]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return "","No valid Data Available"
|
return "","No valid Data Available"
|
||||||
|
|
||||||
@@ -3976,21 +3976,21 @@ def interactive_comparison_chart(id1=0,id2=0,xparam='distance',yparam='spm',
|
|||||||
ymax = 1.0e3*90
|
ymax = 1.0e3*90
|
||||||
ymin = 1.0e3*210
|
ymin = 1.0e3*210
|
||||||
|
|
||||||
ftime1 = rowdata1.ix[:,'ftime']
|
ftime1 = rowdata1.loc[:,'ftime']
|
||||||
ftime2 = rowdata2.ix[:,'ftime']
|
ftime2 = rowdata2.loc[:,'ftime']
|
||||||
|
|
||||||
hr1 = rowdata1.ix[:,'hr']
|
hr1 = rowdata1.loc[:,'hr']
|
||||||
hr2 = rowdata2.ix[:,'hr']
|
hr2 = rowdata2.loc[:,'hr']
|
||||||
|
|
||||||
|
|
||||||
fpace1 = rowdata1.ix[:,'fpace']
|
fpace1 = rowdata1.loc[:,'fpace']
|
||||||
fpace2 = rowdata2.ix[:,'fpace']
|
fpace2 = rowdata2.loc[:,'fpace']
|
||||||
|
|
||||||
distance1 = rowdata1.ix[:,'distance']
|
distance1 = rowdata1.loc[:,'distance']
|
||||||
distance2 = rowdata2.ix[:,'distance']
|
distance2 = rowdata2.loc[:,'distance']
|
||||||
|
|
||||||
spm1 = rowdata1.ix[:,'spm']
|
spm1 = rowdata1.loc[:,'spm']
|
||||||
spm2 = rowdata2.ix[:,'spm']
|
spm2 = rowdata2.loc[:,'spm']
|
||||||
|
|
||||||
if (promember==1):
|
if (promember==1):
|
||||||
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair'
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ urlpatterns += [
|
|||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import debug_toolbar
|
import debug_toolbar
|
||||||
|
import django
|
||||||
urlpatterns += [
|
urlpatterns += [
|
||||||
url(r'^__debug__/',include(debug_toolbar.urls)),
|
url(r'^__debug__/',include(debug_toolbar.urls)),
|
||||||
url(
|
url(r'^static/(?P<path>.*)$',
|
||||||
regex=r'^static/(?P<path>.*)$',
|
django.views.static.serve,
|
||||||
view='django.views.static.serve',
|
|
||||||
kwargs={'document_root': settings.STATIC_ROOT,}
|
kwargs={'document_root': settings.STATIC_ROOT,}
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user