how to import model_to_dict code example Example: how to import model_to_dict from django.forms.models import model_to_dict model_to_dict(instance)