title: How do I create a very simple hyperlink on index.html with flask?
body: <p>Here is my structure:</p>
  
  <pre><code>├── main.py
  ├── static
  │   ├── css
  │   │   └── main.css
  │   ├── img
  │   │   └── main_bkg.jpg
  │   └── js
  └── templates
      ├── myApp
      │   └── myApp.main.html
      └── index.html
  </code></pre>
  
  <p>I just want to create a very simple hyperlink on <code>index.html</code> that links to <code>myApp.main.html</code>.</p>
  
  <p>My <code>main.py</code> looks like:</p>
  
  <pre><code>from flask import Flask, render_template
  app = Flask(__name__)
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  @app.route('/&lt;module&gt;/')
  def myApp(module):
      return render_template('{0}/{0}.main.html'.format(module)) 
  
  @app.route('/user/&lt;username&gt;')
  def show_user_profile(username):
      return 'User %s' % username
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0', debug=True)
  </code></pre>
  
  <p>In my <code>index.html</code>:
  I tried</p>
  
  <pre><code>&lt;a href="{{ url_for('myApp') }}"&gt;&lt;button&gt;myApp&lt;/button&gt;&lt;/a&gt;
  </code></pre>
  
  <p>The flask prompts BuildError <code>BuildError: ('myApp', {}, None)</code></p>
  
  <p>If I try the following on the <code>myApp.main.html</code>, then it provides a valid link back to home page:</p>
  
  <pre><code>&lt;a href="{{ url_for('index') }}"&gt;&lt;button&gt;Home&lt;/button&gt;&lt;/a&gt;
  </code></pre>
  
  <p>What did I miss here?</p>