This code is in django/db/models/fields.py It creates/defines an exception?
class ReverseSingleRelatedObjectDescriptor(six.with_metaclass(RenameRelatedObjec
To catch this exception in general, you can do
from django.core.exceptions import ObjectDoesNotExist try: # Your code here except ObjectDoesNotExist: # Handle exception