Private
Public Access
1
0

gets analytics posts

This commit is contained in:
Sander Roosendaal
2018-10-23 22:18:23 +02:00
parent f3b7d2b17d
commit f519cdca62

View File

@@ -2,9 +2,12 @@ from django.shortcuts import render, redirect, render_to_response
from django.template import RequestContext
from django.conf import settings
from rowers.forms import LoginForm
from django.http import HttpResponse
from rowingdata import main as rmain
import requests
import json
import random
def rootview(request):
@@ -53,7 +56,16 @@ def rootview(request):
'text':'Rowsandall.com is the ideal platform for remote rowing coaching. As a coach, you can easily manage your athletes, set up plans and monitor execution and technique'
}
response = requests.get(
'https://analytics.rowsandall.com/wp-json/wp/v2/posts')
if response.status_code == 200:
blogs_json = response.json()
# with open('blogs.txt','w') as o:
# o.write(json.dumps(blogs_json,indent=2,sort_keys=True))
else:
blogs_json = []
allofferings = [
planoffering,