title: flask preloader before render_template is invoked
body: <p>I have a python app built on flask, now before render_templateis called, the function that passes data values to the html takes a long time to execute. As a result, when I click <a href="http://127.0.0.1:5000/" rel="nofollow noreferrer">http://127.0.0.1:5000/</a> i see a white screen for around 30secs./ 1minute before the html is displayed.Code is something like this </p>
  
  <pre><code>@app.route('/')
  &lt;a long time taking function to pass values to the render function below
  return render_template ('xxx.html',args.values...argsn.valuen) 
  if __name__=="__main__":
      app.run()
  </code></pre>
  
  <p>How do I add a preloader gif even before the render_template html is called? I have seen some answers which talk about displaying a loading gif on click of a button or something like that, but I need to display the loading gif at first load time and when the <a href="http://127.0.0.1:5000/" rel="nofollow noreferrer">http://127.0.0.1:5000/</a> is refreshed using the refresh icon in toolbar. I tried some CSS/HTML tinkering but they only come into picture AFTER the render_template html is called. The program spends a bulk of its time before the render function is even called.</p>