I'm making a page where the user selects elements, confirms his choice, the data is then sent to the backend, and a .csv is made. After the file is created I want the user to be redirected to a page where he can download the file, however
return render_template("tools/downloadfile.html", document=name)
doesn't redirect the user to that page, or any other. There isn't any error in the console, the file is created, but the is no redirection to the page. Do you have any idea of what could cause this ?
@app.route('/createdocument', methods=['POST', 'GET'])
#@login_required
def create_document():
playlists = get_playlists()
if request.method == "POST":
request_data = str(request.data.decode('UTF-8'))
genre = get_header_genre(request_data)
parsed_data = parse_request(request_data)
playlist_names = get_parsed_playlists(parsed_data)
if genre == "playlist":
#make_playlist_doc(playlist_names, genre)
print("playlist option not ready yet")
elif genre == "socan":
name = make_socan_doc(playlist_names, genre)
return render_template("tools/downloadfile.html", document=name)
else:
print("other request:")
print(str(request.data.decode('UTF-8')))
return render_template("tools/createdocument.html", playlists=playlists)