You can also make it simple
from django.db.models import Sum
product_total= Product.objects.aggregate(price=Sum('price'))['price'] or 0
which will give you just the amount. Eg: 4379 so the price is from your database column