def get_date_or_404(year, month, day):
    """Try to make a date from the given inputs, raising Http404 on error"""
    try:
        return datetime.date(int(year), int(month), int(day))
    except ValueError:
        raise Http404