Impor ObjectDoesNotexist

from django.core.exceptions import ObjectDoesNotExist
Vast Vicuña