This commit is contained in:
guange 2019-01-18 15:28:34 +08:00
parent 06f2e1c990
commit ee0472f48b
2 changed files with 9 additions and 4 deletions

View File

@ -6,6 +6,12 @@
<title>Spark大型电商大数据分析</title> <title>Spark大型电商大数据分析</title>
<link href="{% static "styles/common.css" %}" rel="stylesheet"> <link href="{% static "styles/common.css" %}" rel="stylesheet">
<script type="text/javascript">
var from_type_info = {{from_type_info|safe}};
</script>
<script src="{% static "scripts/Plugin/jquery-3.3.1.min.js" %}"></script> <script src="{% static "scripts/Plugin/jquery-3.3.1.min.js" %}"></script>
<script src="{% static "scripts/Plugin/echarts.min.js" %}"></script> <script src="{% static "scripts/Plugin/echarts.min.js" %}"></script>
<script src="{% static "scripts/common.js" %}"></script> <script src="{% static "scripts/common.js" %}"></script>

View File

@ -1,7 +1,7 @@
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from . import scrapy_client 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 from myapp.utils import get_platform_info
import json import json
@ -28,6 +28,5 @@ def crawl(request):
"last_day_comment": json.dumps(last_day_comment)}) "last_day_comment": json.dumps(last_day_comment)})
def result(request): def result(request):
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})
return render(request, 'myapp/result.html')