How to render data to a {% included a.html %} template in Django
问题 I have a rank.html which is a publicly sharing template for many other templates through {% include rank.html %} method. This template will display the 48 hours hot news base on the click number. Here is the view.py: def rank(self, request): hot_news_48h = h_mostViewed(48, News, '-pv') return render(request, "rank.html", { 'hot_news_48h': hot_news_48h,}) h_mostViewed(48, News, '-pv') is a function,that can fetch most viewed(clicked) post within 48 hours.It works. Here is the rank.html: <ul> {