def get_daterange_or_404(start, end):
    dates = DateForm(data={'start': start, 'end': end})
    if not dates.is_valid():
        logger.info('Dates parsed were not valid.')
        raise http.Http404

    return (
        dates.cleaned_data['start'],
        dates.cleaned_data['end']
    )
Parse and validate a pair of YYYYMMDD date strings.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/stats/views.py/get_daterange_or_404