So the error was that in the lines
start = request.form.get('start') end = request.form.get('end')
instead of the 'start' and the 'end' value i was supposed to put 'from' and 'to' but i mean it is what it is we fix it