From ee0472f48be402826891156161c80ea7925976bb Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Jan 2019 15:28:34 +0800 Subject: [PATCH] . --- chapter2/mysite/myapp/templates/myapp/result.html | 6 ++++++ chapter2/mysite/myapp/views.py | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/chapter2/mysite/myapp/templates/myapp/result.html b/chapter2/mysite/myapp/templates/myapp/result.html index 8e36d4a..1a3ab2f 100644 --- a/chapter2/mysite/myapp/templates/myapp/result.html +++ b/chapter2/mysite/myapp/templates/myapp/result.html @@ -6,6 +6,12 @@ Spark大型电商大数据分析 + + + + diff --git a/chapter2/mysite/myapp/views.py b/chapter2/mysite/myapp/views.py index 91efef5..c892ccd 100644 --- a/chapter2/mysite/myapp/views.py +++ b/chapter2/mysite/myapp/views.py @@ -1,7 +1,7 @@ from django.shortcuts import render from django.http import HttpResponse from . import scrapy_client -from myapp.models import CrawlInfos,PlatformInfos, News,LastDayCounts +from myapp.models import CrawlInfos,PlatformInfos, News,LastDayCounts, Datas from myapp.utils import get_platform_info import json @@ -28,6 +28,5 @@ def crawl(request): "last_day_comment": json.dumps(last_day_comment)}) def result(request): - - - return render(request, 'myapp/result.html') \ No newline at end of file + from_type_info = json.loads(Datas.objects.filter(key='from_type').first().data) + return render(request, 'myapp/result.html', {"from_type_info": from_type_info}) \ No newline at end of file