If you getting this error, it might be because you are returning Http404 instead of raising it.
you need to raise django.http.Http404, not return it.
example code :
from django.http import Http404 def my_view(request): try: my_object = MyModel.objects.get(pk=1) except MyModel.DoesNotExist: raise Http404
Pingback: Handling two Django models in a single POST | Shashank's Blog