from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save

app = Flask(__name__)

# @app.route('/')
# def main():
#     return redirect('/index')

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    else:
        pitcher = request.form['pitcher']
        image_file = pitcher.lower()
        image_file = image_file.split()
        image_file = '_'.join(image_file) + '.png'

        return render_template('results.html', image_file = image_file)

if __name__ == '__main__':
    app.run(port=33508)
from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save

app = Flask(__name__)

@app.route('/')
def main():
    return redirect('/index')

@app.route('/index', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    else:
        pitcher = request.form['pitcher']
        image_file = pitcher.lower()
        image_file = image_file.split()
        image_file = '_'.join(image_file) + '.png'

        return render_template('results.html', image_file = image_file)

if __name__ == '__main__':
    app.run(port=33508)
Revert "Remove redirect to avoid Chrome privacy error"
Revert "Remove redirect to avoid Chrome privacy error"

This reverts commit e5322958f14b2428b74de726476fd98adae8c454.

  from flask import Flask, render_template, request, redirect
  import requests
  import pandas as pd
  from datetime import datetime
  from bokeh.plotting import figure, output_notebook, output_file, save
  
  app = Flask(__name__)
  
- # @app.route('/')
+ @app.route('/')
- # def main():
+ def main():
- #     return redirect('/index')
+     return redirect('/index')
  
- @app.route('/', methods=['GET', 'POST'])
+ @app.route('/index', methods=['GET', 'POST'])
  def index():
      if request.method == 'GET':
          return render_template('index.html')
      else:
          pitcher = request.form['pitcher']
          image_file = pitcher.lower()
          image_file = image_file.split()
          image_file = '_'.join(image_file) + '.png'
  
          return render_template('results.html', image_file = image_file)
  
  if __name__ == '__main__':
      app.run(port=33508)
Revert "Remove redirect to avoid Chrome privacy error"
## Code Before:
from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save

app = Flask(__name__)

# @app.route('/')
# def main():
#     return redirect('/index')

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    else:
        pitcher = request.form['pitcher']
        image_file = pitcher.lower()
        image_file = image_file.split()
        image_file = '_'.join(image_file) + '.png'

        return render_template('results.html', image_file = image_file)

if __name__ == '__main__':
    app.run(port=33508)
## Instruction:
Revert "Remove redirect to avoid Chrome privacy error"
## Code After:
from flask import Flask, render_template, request, redirect
import requests
import pandas as pd
from datetime import datetime
from bokeh.plotting import figure, output_notebook, output_file, save

app = Flask(__name__)

@app.route('/')
def main():
    return redirect('/index')

@app.route('/index', methods=['GET', 'POST'])
def index():
    if request.method == 'GET':
        return render_template('index.html')
    else:
        pitcher = request.form['pitcher']
        image_file = pitcher.lower()
        image_file = image_file.split()
        image_file = '_'.join(image_file) + '.png'

        return render_template('results.html', image_file = image_file)

if __name__ == '__main__':
    app.run(port=33508)