title: Flask - Redirect to a "success" page
body: <p>i'm new to Flask. And i'm trying to redirect the user to a "success" page where he can download the csv file that my program had create for him.</p>
  
  <p>so my server.py look like this:</p>
  
  <pre><code>from flask import Flask, request, abort, redirect
  from flask_cors import cross_origin
  import process
  
  app = Flask(__name__)
  
  
  @app.route('/ind', methods=['POST'])
  @cross_origin(origin='localhost', headers=['Content- Type', 'Authorization'])
   def ind():
      if not request.json:
         abort(400)
      my_json = request.json
      reponse = process.process(my_json)
      if reponse:
         return redirect("http://localhost:8080/success", code=302)
      else:
         return redirect("http://localhost:8080/fail", code=302)
  
  
  @app.route('/position', methods=['POST'])
  @cross_origin(origin='localhost', headers=['Content- Type', 'Authorization'])
  def position():
     if not request.json:
        abort(400)
     my_json = request.json
     reponse = process.process(my_json)
     if reponse:
        return redirect("http://localhost:8080/success", code=302)
     else:
        return redirect("http://localhost:8080/fail", code=302)
  
  
  if __name__ == '__main__':
     app.run(host='0.0.0.0', port=5050, debug=True)
  </code></pre>
  
  <p>my process.py where the JSON that i received is transformed and transcripts to a csv file, look like this:</p>
  
  <pre><code>    def process(my_json):
          [blablabla...]
      return True
  </code></pre>
  
  <p>"reponse" is always True but no redirection, what am i doing wrong ? </p>