title: flask not redirecting to new page after redirect(url_for())
body: <p>I have a simple app that needs to run a subprocess.call in celery and simply return some text to the screen as it's been successfully submitted.  </p>
  
  <p>Try as I might, I have been unable to make the redirect(url_for()) do anything.  I see in the log that I get a 302 and a 200 but no new page in the browser window.</p>
  
  <p>Here is my the pertinent part of my server.py code:</p>
  
  <pre><code>#!/usr/bin/python
  
  import os
  from flask import Flask, url_for, jsonify, request, make_response, render_template, json, flash, Markup, redirect
  from celery import Celery, states
  from flask_cors import CORS, cross_origin
  import pandas as pd
  import subprocess
  
  app = Flask(__name__)
  CORS(app)
  app.secret_key = 'random string'
  app.config['CELERY_BROKER_URL'] = 'amqp://cluster:cluster@localhost/myvhost'
  app.config['CELERY_RESULT_BACKEND'] = 'amqp://cluster:cluster@localhost/myvhost'
  celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
  celery.conf.update(app.config)
  
  
  @app.route('/')
  def main():
      return render_template('index.html')
  
  @app.route('/showPrevNext')
  def showPrevNext():
      return render_template('prevnext.html')
  
  @app.route('/PrevNext',methods=['GET','POST'])
  def prevNext():
      _uid      = request.form['inputUid']
      _db   = request.form['inputName']
      _TableName = request.form['inputTableName']
      if  _id:
          uid = _uid
          if _db:
              db = _db
              if _TableName:
                  TableName = _TableName
                  flash("Running  images!")
                  return redirect(url_for('main'))
                  create_some_stuff.delay(uid,db,TableName)
  </code></pre>
  
  <p>create_some_stuff is a celery task that runs fine but I am having trouble making the redirect work.  After many hours of toying, I hope one of you can help please?</p>
  
  <p>output from the console is:</p>
  
  <pre><code> * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
   * Restarting with stat
   * Debugger is active!
   * Debugger pin code: 270-380-963
  192.168.200.238 - - [15/Feb/2018 16:55:07] "POST /PrevNext HTTP/1.1" 302 -
  192.168.200.238 - - [15/Feb/2018 16:55:08] "GET / HTTP/1.1" 200 -
  </code></pre>
  
  <p>Am I missing something simple?</p>
  
  <p>Thanks</p>