Python - Exception "No template named index" in lpthw.web framework
<p>I am going through a short Python tutorial, but I can't get the last exercise to work.
This is the source code of app.py</p>

<pre><code>import web

urls = (
    '/', 'Index'
)

app = web.application(urls, globals())

render = web.template.render('templates/')

class Index(object):
    def GET(self):
        greeting = "Hello World"
        return render.index(greeting = greeting)

if __name__ == "__main__":
    app.run() 
</code></pre>

<p>and this is the view, index.html</p>

<pre><code>$def with (greeting)

&lt;html&gt;

    &lt;head&gt;

        &lt;title&gt;Gothons of Planet Percal #25&lt;/title&gt;

    &lt;/head&gt;

&lt;body&gt;

$if greeting:
    I just wanted to say &lt;em style="color: green; font-size: 2em;"&gt;
    greeting&lt;/em&gt;.

$else:
    &lt;em&gt;Hello&lt;/em&gt;, world!

&lt;/body&gt;

&lt;/html&gt; 
</code></pre>

<p>The file app.py is under this directory: C:\Users\Lucas\Desktop\Learn Python The Hard Way\ex50\gothonweb\bin
and index.html is at: C:\Users\Lucas\Desktop\Learn Python The Hard Way\ex50\gothonweb\templates</p>

<p>So, when I want to run the sample code, I type this in the command prompt:</p>

<pre><code>C:\Python26\python.exe "C:\Users\Lucas\Desktop\Learn Python The Hard Way\ex50\gothonweb\bin\app.py"
</code></pre>

<p>After that, <strong>"http://0.0.0:8080"</strong> is displayed on the console, so I go to <a href="http://localhost:8080/" rel="nofollow">http://localhost:8080/</a> in my browser
but I get back a long traceback starting with </p>

<pre><code>&lt;type 'exceptions.AttributeError'&gt; at /
No template named index
Python  C:\Python26\lib\site-packages\web\template.py in _load_template, line 992 
Web     GET http://localhost:8080/
</code></pre>

<p>What is going on and how do I fix it?</p>

<p>Thanks in advance!</p>
