django orm sum

# Import the necessary modules
from django.db.models import Sum
from yourapp.models import YourModel

# Use Django ORM to perform a sum aggregation on a specific field
result = YourModel.objects.aggregate(total_sum=Sum('your_field'))

# Access the result of the aggregation
total_sum_value = result['total_sum']

# Print or use the aggregated value as needed
print(total_sum_value)