[root@yyjk F5]#pwd
/django/mysite/news/templates/F5
[root@yyjk F5]#cat displayf5.html
<table class="gridtable fr">
<tr><th>F5监控</th></tr>
</table>
2. views.py
def displayf5(req):
return render_to_response('F5/displayf5.html')
3.
[root@yyjk F5]#cat displayf5.html
<table class="gridtable fr">
<h1 align="center" ><font color="blue">F5????</font></h1>
</table>
<script type="text/javascript" src="/static/Js/jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="/static/Js/F5/displayf5.js"></script>
[root@yyjk F5]#
4.
django 直接将后台数据(数组)分配给前台
print type(list)
for a in list:
print a
#return HttpResponse(json.dumps(list) , content_type="application/json")
return render(req,'F5/displayf5.html',{'info':list})
5.
[root@yyjk F5]#pwd
/django/mysite/news/templates/F5
[root@yyjk F5]#cat displayf5.html
<table class="gridtable fr">
<h1 align="center" ><font color="blue">F5????</font></h1>
</table>
{{info}}
<script type="text/javascript" src="/static/Js/jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="/static/Js/F5/displayf5.js"></script>