serving an image with python and flask not working
<p>I reduced the code for this to, I think, minimum while trying to get it to work:
The python:</p>

<pre><code>#!/usr/bin/env python
from functools import wraps
from flask import Flask, render_template, session, request, redirect, url_for
from flask_socketio import SocketIO, emit, join_room, leave_room, \
    close_room, rooms, disconnect


async_mode = None

app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app, async_mode=async_mode)

@app.route('/')
def index():
    return render_template('index_test.html')


if __name__ == '__main__':
    socketio.run(app, debug=True)
</code></pre>

<p>The html:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;img src="{{ url_for('index') }}bulboff.gif"/&gt;
    &lt;p&gt;"{{ url_for('index') }}" &lt;p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The image is in the static folder.</p>

<p>And it gives this error:</p>

<p>"GET /bulboff.gif HTTP/1.1" 404</p>

<p>when the page is accessed.</p>

<p>I've tried several things like setting the Flask default paths, without the url_for, etc, but, still no image.</p>

<p>What am I missing?</p>