Is there a function like the get_object_or_404 to not display a 404 error? I have this in my views and I would like to display the page regardless if it finds posts:
tag = get_object_or_404(Keyword, slug=tag)
No, I think django doesn't have it is because django shouldn't assume what's the default value if the query is not found. Do this:
try:
tag = Keyword.objects.get(slug=tag)
except Keyword.DoesNotExist:
tag = None