1๐
โ
You are using ListView
incorrectly. You assign queriset
attribute with something that is not a QuerySet
. This means that you fetch the data only once (at the moment of importing the views.py
).
Every time when the request to the view comes it uses the data in the queryset
attribute. If you want to fetch new data on every request you need to overwrite get_queryset
method. Something like:
class ContainerList(ListView):
template_name = 'containers.html'
def get_queryset(self):
return container_list()
This will fetch the data on every request.
๐คVStoykov
0๐
If I remember correctly, you will need a signal processor to watch for changes, and when it notices a change, it will update via an AJAX call to the template, replacing with new data.
๐คRoninDusette
- [Answer]-Template changes are not appearing in Django admin site
- [Answer]-Django OAuth Toolkit protected_resource for class-based views
- [Answer]-Where does django get initial fixtures from on manage.py test?
Source:stackexchange.com