title: Data in Flask web app not updating [Python]
body: <p>I have a flask app that fills a html table with data that it gets from a <code>Pickle</code> file in the <code>static</code> folder. I have an external application that updates that Pickle file once a minute.</p>
  
  <p>The <code>views.py</code> file opens up that Pickle file and loads the data, which is then sent to an html template.</p>
  
  <p>I got the app running, although no matter how many times I refresh the page, the data is the same as when I first started the app in my terminal.</p>
  
  <p>I am starting it via <code>uwsgi --socket 127.0.0.1:3031 --wsgi-file run_web.py --callable app --processes 4 --threads 2 --stats 127.0.0.1:9191</code> in a <code>screen</code> instance.</p>
  
  <p>What did I forget to do to make my data refresh properly?</p>
  
  <p>I am using <code>uswgi</code> and <code>nginx</code> to host a Flask app</p>
  
  <p><strong>views.py</strong>...</p>
  
  <pre><code>import all the things    
  
  with open('/home/metheuser/webapps/ers_portal/app/static/' + ec.dd_filename) as f:
       data = pickle.load(f)
  
  column_names = data.pop('__column_names__')
  column_names.insert(2, 'Screen Viewer')
  column_names.insert(3, 'Site Page')
  sites = data.keys()
  
  for sitename in data:
      data[sitename].insert(2, ec.unit_roster[sitename]['ip_address'])
      data[sitename].insert(3, 'doesn\'tgoanywhereyet...')
  
  dbt = da.Database_Authenticator(admin=False)
  
  #************************************************
  lm = LoginManager()
  lm.init_app(app)
  lm.login_view = 'login'
  
  def authenticate(un, typed_pw, remember=False):
      """login with database"""
      my_user = dbt.authenticate_user(un, typed_pw)
      if my_user: #  user is authenticated
          return my_user
      else:
          return False
  
  @lm.user_loader
  def load_user(userid):
      print 'user id:',userid
      try:
          return dbt.get_user_by_id(userid)
      except AttributeError:
          return None
  
  @app.before_request
  def before_request():
      g.user = current_user
  
  @app.route('/')
  @app.route('/index')
  def index():
      return render_template("index.html",
                             title = 'Main',)
  
  @app.route('/login', methods = ['GET', 'POST'])
  def login():
      if g.user is not None:
          if g.user.is_authenticated():
              return redirect(request.args.get('next') or 'index')
      form = LoginForm()
      if form.validate_on_submit():
          authed_user = authenticate(form.username.data, form.typed_pw.data, form.remember_me.data)
          if authed_user:
              authed_user.authenticated = True
              u = login_user(authed_user, form.remember_me.data)
          return redirect(request.args.get('next') or 'index')
      return render_template('login.html',
          title = 'Sign In',
          form = form)
  
  @app.route('/logout')
  def logout():
      logout_user()
      return redirect('index')
  
  @app.route('/my_table')
  @login_required
  def my_table():
      print 'trying to access data table...'
      return render_template("my_table.html",
                             title = "Rundata Viewer",
                             sts = sites,
                             cn = column_names,
                             data = data) #  dictionary of data
  </code></pre>