基于jQuery实现瀑布流页面
本文实例为大家分享了jQuery实现瀑布流页面展示的具体代码,供大家参考,具体内容如下
views.py
fromdjango.shortcutsimportrender,HttpResponse
fromapp01importmodels
importjson
#Createyourviewshere.
defindex(req):
ifreq.method=='POST':
dic=models.Upload.objects.filter(status=1).values('img1','name','info')
dic=list(dic)
dic=json.dumps(dic)
print(dic)
returnHttpResponse(dic)
returnrender(req,'index.html')
url.py
fromdjango.conf.urlsimporturl fromdjango.contribimportadmin fromapp01importviews urlpatterns=[ url(r'^admin/',admin.site.urls), url(r'^index/',views.index), ]
index.html
Title