web.py ImportError on Windows

58 views
Skip to first unread message

Pete D

unread,
Sep 14, 2012, 2:29:18 PM9/14/12
to we...@googlegroups.com
I ran the simple code from the tutorial for templates on a PC and I keep getting the following error

ImportError: No module named templates

whenever I do this render = web.template.render('templates/')
I have the template directory set up with an html file in it.

Here is the code
import web

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

urls = (
    '/', 'index'
)

class index:
    def GET(self):
        return render.base()

if __name__ == "__main__":
    app = web.application(urls, globals())
    app.internalerror = web.debugerror
    app.run()

Francois Dion

unread,
Sep 15, 2012, 9:14:52 AM9/15/12
to we...@googlegroups.com
Did you create a template directory or a templates directory? You say you have the template directory set up, it should be templates

Pete D

unread,
Sep 17, 2012, 1:48:57 PM9/17/12
to web.py
I figured it out. If you ever load Google App Engine on your PC.
Web.py automatically assumes you are using it. Then you have to
compile the templates directory as if it were going to be on Google
App Engine
Reply all
Reply to author
Forward
Message has been deleted
0 new messages