title: Serving image with flask
body: <p>I have a program which generates an image. Now I want to use Flask to make this picture accessible to other users, but I can’t display this image with the following code:</p>
  
  <pre><code>#!/usr/bin/python2
  #coding: utf-8
  
  from flask import *
  app = Flask(__name__)
  
  #app.run(host='0.0.0.0')
  
  @app.route('/')
  def index():
      return render_template('hello.html')
  
  if __name__ == '__main__':
      app.run(debug=True,host='0.0.0.0')
  </code></pre>
  
  <p>My template hello.html is:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;title&gt;Hello from Flask&lt;/title&gt;
  &lt;h1&gt;Hello World!&lt;/h1&gt;
  &lt;img src="./weather-plot.png"&gt;
  </code></pre>
  
  <p>When I run this program and visit the page, I see this:</p>
  
  <pre><code>192.168.0.61 - - [10/Jul/2013 10:22:09] "GET / HTTP/1.1" 200 -
  192.168.0.61 - - [10/Jul/2013 10:22:09] "GET /weather-plot.png HTTP/1.1" 200 -
  </code></pre>
  
  <p>And in my browser I see the title, but not the picture. What’s wrong?</p>
  
  <p>By the way, is there a better method to display a picture without anything else? Maybe I don’t have to use a template?</p>