How to Solve NameError: name 'Avg' is not defined -- django

Solution: Import the 'Avg' module

# Add the following line to the top of your code
from django.db.models import Avg

 

For more information:
django Avg