title: How to render template with image in flask?
body: <p>I'm trying to render a template that uses image using flask but I'm encountering the following error:</p>
  
  <blockquote>
    <p>jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'static'.</p>
  </blockquote>
  
  <p>I get the following error message on page:</p>
  
  <pre><code>Internal Server Error
  
  The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
  </code></pre>
  
  <p>I already tried to put the images in the same directory as app.py but the images did not appear. I am using flask 1.0.3.</p>
  
  <p>gallery.html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;body&gt;
  
    &lt;h2&gt;Images Side by Side&lt;/h2&gt;
  
    &lt;div class="row"&gt;
      &lt;div class="column"&gt;
        &lt;img src="{{url_for('static', filename='resultado_final.png)}}" alt="Resultado final" style="width:100%"&gt;
      &lt;/div&gt;
      &lt;div class="column"&gt;
        &lt;img src="{{url_for('static', filename='resultado_final.png)}}" alt="Resultado final" style="width:100%"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>app.py:</p>
  
  <pre class="lang-py prettyprint-override"><code>@app.route('/uploaded/&lt;filename&gt;', methods=['GET', 'POST'])
  def uploaded_image(filename):
      img_seg = main(filename)
      return render_template("gallery.html", name=None)
  </code></pre>
  
  <p>File structure:</p>
  
  <pre><code>app.py
  static
      |----resultado_final.png
  templates
      |----gallery.html
  </code></pre>