title: Display links to new webpages created
body: <p>I'm building a website with Python (using heroku) and I would like to create a "newest submissions" section. That is, when I create a new <code>@app.route(blah)</code> in my Python app, I want a link to the new page to show up under the "newest submissions" section on my homepage. </p>
  
  <p>Is this possible?</p>
  
  <p>EDIT: here's my code</p>
  
  <pre><code>import os
  import json
  from flask import Flask, render_template, url_for
  from werkzeug.routing import Map, Rule, NotFound, RequestRedirect, BaseConverter
  
  app = Flask(__name__)
  
  
  @app.route('/')
  def index():
      return  render_template('welcome.html')
  
  @app.route('/about', endpoint='about')
  def index():
      return  render_template('about.html')
  
  @app.route('/contact', endpoint='contact')
  def index():
      return  render_template('contact.html')
  
  @app.route('/all-links', endpoint='all-links')
  def all_links():
      links = []
      for rule in app.url_map.iter_rules():
          url = url_for(rule.endpoint)
          links.append((url, rule.endpoint))
      return render_template('all_links.html', links=links)
  
  
  
  if __name__ == '__main__':
      # Bind to PORT if defined, otherwise default to 5000.
      port = int(os.environ.get('PORT', 5000))
      app.run(host='0.0.0.0', port=port)
  </code></pre>
  
  <p>and the all_links.html file</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;title&gt;links&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;ul&gt;
              {% for url, endpoint in links %}
              &lt;li&gt;&lt;a href="{{ url }}"&gt;{{ endpoint }}&lt;/a&gt;&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;    
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>