Dropzone doesn't redirect after upload to Flask app <p>I'm writing a resource to upload files to a Flask app using Dropzone. After files are uploaded the app should redirect to the hello world page. This is not happening and the app is stuck on the view that uploaded the files. I'm using jQuery 3.1.0 and Dropzone from master.</p> <pre><code>from flask import Flask, request, flash, redirect, url_for render_template) from validator import Validator ALLOWED_EXTENSIONS = set(['csv', 'xlsx', 'xls']) def allowed_file(filename): return (filename != '') and ('.' in filename) and \ (filename.split('.')[-1] in ALLOWED_EXTENSIONS) def create_app(): app = Flask(__name__) app.secret_key = 'super secret key' return app app = create_app() @app.route('/') def index(): return render_template('index.html') @app.route('/world') def hello_world(): return render_template('hello_world.html') @app.route('/upload', methods=['POST']) def upload(): # check that a file with valid name was uploaded if 'file' not in request.files: flash('No file part') return redirect(request.url) file = request.files['file'] if not allowed_file(file.filename): flash('No selected file') return redirect(request.url) # import ipdb; ipdb.set_trace() validator = Validator(file) validated = validator.validate() if validated: flash('Success') else: flash('Invalid file') return redirect(url_for('hello_world')) if __name__ == '__main__': app.run(debug=True) </code></pre> <pre class="lang-html prettyprint-override"><code>{% extends "base.html" %} {% block head %} &lt;link href="/static/css/dropzone.css" rel="stylesheet"&gt; &lt;script src="/static/js/dropzone.js"&gt;&lt;/script&gt; {% endblock %} {% block body %} &lt;main&gt; &lt;section&gt; &lt;div id="dropzone"&gt; &lt;form action="upload" method="post" class="dropzone dz-clickable" id="demo-upload" multiple&gt; &lt;div class="dz-message"&gt; Drop files here or click to upload. &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/section&gt; &lt;/main&gt; {% endblock %} </code></pre>