title: Loading URLs into an iFrame using Flask
body: <p>I'm new to Flask and 
  I'm trying to create a Stumbleupon like website but I'm having problems while loading the content into an iFrame. I just cant figure it out how to iterate through each url and load them into the iFrame while clicking in the <code>&lt;a&gt;</code> tag.</p>
  
  <p>Here is what I've done:</p>
  
  <p><strong>app.py</strong></p>
  
  <pre><code>from flask import Flask, render_template
  app = Flask(__name__)
  
  @app.route("/")
  def index():
      urls = [
          'http://www.w3schools.com',
          'http://techcrunch.com/',
          'https://www.fayerwayer.com/',
      ]
      return render_template('index.html', urls=urls)
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>
  
  <p><strong>templates/layout.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Document&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="/static/css/normalize.css"/&gt;
      &lt;link rel="stylesheet" type="text/css" href="/static/css/foundation.css"/&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;nav class="top-bar"&gt;
          &lt;h3 align="center"&gt;&lt;a href="?????"&gt;Stumble&lt;/a&gt;&lt;/h3&gt;
      &lt;/nav&gt;
  
      {% block content %} 
      {% endblock content %}
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>templates/index.html</strong></p>
  
  <pre><code>{% extends 'layout.html' %}
  {% block content %}
      &lt;iframe frameborder='0' noresize='noresize' style='position: absolute; background: transparent; width: 100%; height:100%;' src="????????" frameborder="0"&gt;&lt;/iframe&gt;
  {% endblock content %}
  </code></pre>