When I ask the model manager to get an object, it raises DoesNotExist when there is no matching object.
go = Content.objects.get(name=\"baby\")
From django docs
get()raises aDoesNotExistexception if an object is not found for the given parameters. This exception is also an attribute of the model class. TheDoesNotExistexception inherits fromdjango.core.exceptions.ObjectDoesNotExist
You can catch the exception and assign None to go.
from django.core.exceptions import ObjectDoesNotExist
try:
go = Content.objects.get(name="baby")
except ObjectDoesNotExist:
go = None