我如何使统计信息仪表板自动刷新,并提供业务的最新收入和交易,而无需用户单击浏览器中的刷新按钮。我想要一个类似于Yahoo Finance上的比特币USD图表的实现,其中的数据无需刷新即可更改:https://finance.yahoo.com/quote/BTC-USD?p=BTC-USD
views.py
@login_required()
def dashboard(request):
business = get_object_or_404(Business, businessperson=request.user)
return render(request, 'business/dashboard.html', {
"business": business,
})
dashboard.html
{% extends my_base %}
{% load static %}
<title>Dashboard</title>
{% endblock %}
{% block content %}
<h1>Dashboard</h1>
<h2>{{business.name}}</h2>
<p>{{business.transactions}}</p>
<p>{{business.revenue}}</p>
{% endblock %}