title: Get nested dict items using Jinja2 in Flask
body: <p>for this dictionary with this Flask controller</p>
  
  <pre><code>projects = {
          'life-calc':{'url':'life-calc',
                      'title': 'Life Calculator'},
          'text-game':{'url':'text-game',
                      'title':'Text Adventure'},
          'fill-it-up':{'url':'fill-it-up',
                      'title':'Fill It Up'},
          'rock-paper-scissors':{'url':'rock-paper-scissors',
                      'title':'Rock, Paper, Scissors'},
          'bubble-popper':{'url':'bubble-popper',
                      'title':'Bubble Popper'}
              }
  
  
  @app.route('/')
  def index():
      return render_template("index.html",
                              projects = projects)
  </code></pre>
  
  <p>and the template as such</p>
  
  <pre><code>    &lt;h1&gt;
          List of My Projects
      &lt;/h1&gt;
  
      &lt;ol&gt;
          &lt;li&gt;
              &lt;a href = "life-calc"&gt;Life Calculator&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;a href = "text-game"&gt;Adventure Game&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;a href = "fill-it-up"&gt;Fill It Up&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;a href = "rock-paper-scissors"&gt;Rock Paper Scissors&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;a href = "bubble-popper"&gt;Bubble Popper&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ol&gt;
      &lt;p&gt;test section below&lt;/p&gt;
      &lt;ol&gt;
          {% for project in projects %}
          &lt;li&gt;&lt;a href = "{{ project['url'] }}"&gt;{{ project['title'] }}&lt;/a&gt; &lt;/li&gt;
          {% endfor %}
      &lt;/ol&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>How can I access the items in the dict to print a list of my projects as in the HTML above the test?</p>
  
  <p>I solved my own problem with help from <a href="https://stackoverflow.com/questions/19141073/rendering-a-python-dict-in-jinja2-werkzeug">Rendering a python dict in Jinja2 / Werkzeug</a>
  The template block should be </p>
  
  <pre><code>{% for key, value in projects.iteritems() %}
  &lt;li&gt;&lt;a href={{value['url']}}&gt;{{value['title']}}&lt;/a&gt;&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>But I'm still curious as to how to access further nested dictionaries, and if this is the smartest way to create a simple menu.</p>