title: I'm trying to get render_template to work on my website, having trouble
body: <p>It's my "first day" at this, so please bear with me. </p>
  
  <p>I'm trying to get render_template to work so I can use Python to work over html using the program Flask. I've gone through the tutorials, but they only tell me how to execute the code through terminal, and only then by calling Python explicitly. I've made the three files (routes.py, layout, and home) I need to get the functionality to work and put them in the (app folder, template folder in app, template folder in app). I then put the app folder in the public_html file on my server. </p>
  
  <p>When I go to the "mywebpage"/app/template/home.html address I get the html file as originally written without the {{}} variables replaced. Completely stumped. I don't know if I have to explicitly call the routes.py file explicitly in an html file, whether I have to tell DirectoryIndex in .htaccess to look for it, or if the server should find it in the app folder by itself. But basically I know routes.py calls the other files, but I don't know how routes.py gets called. </p>
  
  <p>Here is my code:</p>
  
  <p><strong>routes.py</strong></p>
  
  <pre><code>from flask import Flask, render_template
  
  app = Flask(__name__)      
  
  @app.route('mywebsite')
  def home():
     user = {'nickname': 'Miguel'}  # fake user
     return render_template('home.html', user = user)
  
  '''if __name__ == '__main__':'''
  app.run(debug=True)
  </code></pre>
  
  <p><strong>home.html</strong></p>
  
  <pre><code>{% extends "layout.html" %}
  {% block content %}
    &lt;div class="jumbo"&gt;
      &lt;h2&gt;Welcome to the Flask app&lt;h2&gt;
      &lt;h3&gt;This is the home page for the Flask app&lt;h3&gt;
    &lt;/div&gt;
    &lt;body&gt;
        &lt;p&gt; Hello, {{user.nickname}} &lt;/p&gt;
     &lt;/body&gt;
  {% endblock %}
  </code></pre>
  
  <p><strong>layout.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Flask App&lt;/title&gt;    
    &lt;/head&gt;
    &lt;body&gt;
  
      &lt;header&gt;
        &lt;div class="container"&gt;
          &lt;h1 class="logo"&gt;Flask App&lt;/h1&gt;
        &lt;/div&gt;
      &lt;/header&gt; 
  
      &lt;div class="container"&gt;
        {% block content %}
        {% endblock %}
      &lt;/div&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Finally, be nice. I've done everything I can think of to get to this point. </p>
  
  <p>EDIT: This website:</p>
  
  <p><a href="http://melvin0008.github.io/blog/build-a-redditapi-using-python/" rel="nofollow noreferrer">http://melvin0008.github.io/blog/build-a-redditapi-using-python/</a></p>
  
  <p>says that @app.route('/pants') should make mywebsite.com/pants display the rendered template. I've tried that with my route.py document both in the root public_html folder and in the app folder. Neither worked. website.com/pants isn't seen by my server.</p>