trying to get it to run on manjaro linux
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -55,3 +55,4 @@ config.yaml
|
|||||||
# virtualenv
|
# virtualenv
|
||||||
/venv/
|
/venv/
|
||||||
/py27/
|
/py27/
|
||||||
|
/py2/
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
def google_analytics(request):
|
def google_analytics(request):
|
||||||
"""
|
"""
|
||||||
Use the variables returned in this function to
|
Use the variables returned in this function to
|
||||||
render your Google Analytics tracking code template.
|
render your Google Analytics tracking code template.
|
||||||
"""
|
"""
|
||||||
ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_ID', False)
|
ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_ID', False)
|
||||||
ga_domain = getattr(settings, 'GOOGLE_ANALYTICS_DOMAIN', False)
|
ga_domain = getattr(settings, 'GOOGLE_ANALYTICS_DOMAIN', False)
|
||||||
if not settings.DEBUG and ga_prop_id and ga_domain:
|
if not settings.DEBUG and ga_prop_id and ga_domain:
|
||||||
return {
|
return {
|
||||||
'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id,
|
'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id,
|
||||||
'GOOGLE_ANALYTICS_DOMAIN': ga_domain,
|
'GOOGLE_ANALYTICS_DOMAIN': ga_domain,
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def hello_world(request):
|
def hello_world(request):
|
||||||
return {
|
return {
|
||||||
'helloworld': 'hi Sander'
|
'helloworld': 'hi Sander'
|
||||||
}
|
}
|
||||||
|
|
||||||
def warning_message(request):
|
def warning_message(request):
|
||||||
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}
|
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}
|
||||||
|
|||||||
@@ -65,14 +65,14 @@ from rowers.dataprepnodjango import (
|
|||||||
add_c2_stroke_data_db,totaltime_sec_to_string,
|
add_c2_stroke_data_db,totaltime_sec_to_string,
|
||||||
create_c2_stroke_data_db,update_empower,
|
create_c2_stroke_data_db,update_empower,
|
||||||
database_url_debug,database_url,dataprep,
|
database_url_debug,database_url,dataprep,
|
||||||
# create_strava_stroke_data_db
|
# create_strava_stroke_data_db
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
from django.core.mail import (
|
from django.core.mail import (
|
||||||
send_mail,
|
send_mail,
|
||||||
EmailMessage,EmailMultiAlternatives,
|
EmailMessage,EmailMultiAlternatives,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django.template import Context
|
from django.template import Context
|
||||||
from django.db.utils import OperationalError
|
from django.db.utils import OperationalError
|
||||||
@@ -106,7 +106,7 @@ def handle_c2_import_stroke_data(c2token,
|
|||||||
c2id,workoutid,
|
c2id,workoutid,
|
||||||
starttimeunix,
|
starttimeunix,
|
||||||
csvfilename,debug=True,**kwargs):
|
csvfilename,debug=True,**kwargs):
|
||||||
|
|
||||||
if 'workouttype' in kwargs:
|
if 'workouttype' in kwargs:
|
||||||
workouttype = kwargs['workouttype']
|
workouttype = kwargs['workouttype']
|
||||||
else:
|
else:
|
||||||
@@ -124,12 +124,13 @@ def handle_c2_import_stroke_data(c2token,
|
|||||||
strokedata,workoutid,starttimeunix,
|
strokedata,workoutid,starttimeunix,
|
||||||
csvfilename,debug=debug,workouttype=workouttype
|
csvfilename,debug=debug,workouttype=workouttype
|
||||||
)
|
)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
url = "https://log.concept2.com/api/users/me/results/"+str(c2id)
|
url = "https://log.concept2.com/api/users/me/results/"+str(c2id)
|
||||||
|
|
||||||
s = requests.get(url,headers=headers)
|
s = requests.get(url,headers=headers)
|
||||||
|
|
||||||
if s.status_code == 200:
|
if s.status_code == 200:
|
||||||
workoutdata = s.json()['data']
|
workoutdata = s.json()['data']
|
||||||
distance = workoutdata['distance']
|
distance = workoutdata['distance']
|
||||||
|
|||||||
Reference in New Issue
Block a user