title: Displaying a .txt file in my html using Python Flask
body: <p>I want to display my log.txt in my log.html.
  For some reason my page is completely blank.
  And I dont get to see anything from my file.
  Code:</p>
  
  <pre><code>def log():
      with open("logs.txt", "r") as f:
          content = f.read()
      return render_template('log.html', content=content)
  </code></pre>
  
  <p>HTML LOG TEMPLATE:</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Log&lt;/title&gt;
      &lt;link rel="stylesheet" href="/static/styles/nav.css" /&gt;
       &lt;link rel="stylesheet" href="/static/styles/basiclayout.css" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;/head&gt;
  &lt;style&gt;
  
  
  &lt;/style&gt;
  &lt;body&gt;
  &lt;ul class="nav"&gt;
      &lt;li &gt;&lt;a href="{{ url_for('hello_world') }}" &gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li &gt;&lt;a href="{{ url_for('notepad') }}"&gt;Notepad&lt;/a&gt;&lt;/li&gt;
      &lt;li &gt;&lt;a href="{{ url_for('explorer') }}"&gt;Explorer &lt;/a&gt;&lt;/li&gt;
      &lt;li class="active"&gt;&lt;a href="{{ url_for('log') }}"&gt;Log &lt;/a&gt;&lt;/li&gt;
      &lt;li &gt;&lt;a href="{{ url_for('upload') }}"&gt;Upload &lt;/a&gt;&lt;/li&gt;
      &lt;li &gt;&lt;a href="{{ url_for('uploads') }}"&gt;Uploads &lt;/a&gt;&lt;/li&gt;
      &lt;li &gt;&lt;a href="{{ url_for('logout') }}"&gt;Logout&lt;/a&gt;&lt;/li&gt;
  
  
  
  &lt;/ul&gt;
  &lt;div class="alert"&gt;
      {% for message in get_flashed_messages() %}
         {{ message }}
      {% endfor %}
          &lt;/div&gt;
  
      &lt;pre&gt;{{ content }}&lt;/pre&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Added my HTML Template now.</p>