我的應用程序在Django 可以創建一些非常大SQL查詢。我目前使用HttpRequest
對象來獲取我需要的數據,然後使用HttpResponse
來返回我想要顯示的用戶。更新HttpResponse每隔幾秒
顯然,我可以讓用戶等待一分鐘,同時執行這些多組查詢並從數據庫中提取,然後返回這個monolothic HTML頁面。
理想情況下,我想更新頁面時,我想,是這樣的:
For i,e in enumerate(example):
Table.objects.filter(someObjectForFilter[i]).
#Return the object to the page.
#Then Loop again, 'updating' the response after each iteration.
這可能嗎?