2016-12-04 93 views

回答

2

Functional based view需要採取一個request說法,所以這裏是修復:

@cache_page(3600) 
def get_big_items_html(request): 
    .... 
    return HttpResponse('some html string') 
+0

所以它可以幫助,但我得到另一個錯誤:「SafeText」對象有沒有屬性「流式」 。我的網站上有類別,必須獲取所有類別和模板才能呈現類別,我希望保存爲類別與模板合併結果的現金字符串。 – icdu91

+0

查看需要返回的HttpResponse對象,所以只需改爲'return HttpResponse('你的html')' – vanadium23

相關問題