CODE NOT TESTED
You can do this in the get_context_data method, in the view:
from django.db.models import Sum
chart_data = {}
for date in Expense.objects.all().distinct('date').values_list('date', flat=True):
chart_data[date] = Expense.objects.filter(date=date).aggregate(Sum('amount'))['total__sum']
context['chart_data'] = chart_data
and this in the related template:
{% for key, value in chart_data.items %}
<tr>
<td>{{ key }}</td>
<td>{{ value }}</td>
</tr>
{% endfor %}