first version with blog posts
This commit is contained in:
@@ -58,6 +58,7 @@ urlpatterns += [
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
url(r'^$',rootview),
|
||||
url(r'^getblogs$',rowersviews.get_blog_posts),
|
||||
url(r'^login/',auth_views.login, name='login'),
|
||||
url(r'^logout/$',auth_views.logout,
|
||||
{'next_page': '/'},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django.shortcuts import render, redirect, render_to_response
|
||||
from django.template.loader import render_to_string
|
||||
from django.template import RequestContext
|
||||
from django.conf import settings
|
||||
from rowers.forms import LoginForm
|
||||
@@ -6,9 +7,9 @@ from django.http import HttpResponse
|
||||
|
||||
from rowingdata import main as rmain
|
||||
|
||||
import requests
|
||||
import json
|
||||
|
||||
import random
|
||||
|
||||
|
||||
def rootview(request):
|
||||
magicsentence = rmain()
|
||||
@@ -56,15 +57,6 @@ 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 = [
|
||||
|
||||
Reference in New Issue
Block a user