avoid this error "global name DoesNotExist is not defined"