This commit is contained in:
parent
b2382f4f04
commit
a3f89ca9b3
|
@ -6,12 +6,11 @@
|
|||
<title>Spark大型电商大数据分析</title>
|
||||
<link href="{% static "styles/common.css" %}" rel="stylesheet">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var from_type_info = {{from_type_info|safe}};
|
||||
var top10_sells = {{top10_sells|safe}};
|
||||
</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/common.js" %}"></script>
|
||||
|
|
|
@ -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, Datas
|
||||
from myapp.models import CrawlInfos,PlatformInfos, News,LastDayCounts, Datas, Top10Sells
|
||||
from myapp.utils import get_platform_info
|
||||
import json
|
||||
|
||||
|
@ -29,4 +29,6 @@ def crawl(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})
|
||||
top10_sells = Top10Sells.objects.order_by('id').values()
|
||||
return render(request, 'myapp/result.html', {"from_type_info": from_type_info,
|
||||
"top10_sells": top10_sells})
|
Loading…
Reference in New Issue