Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:17:25+00:00 2026-06-01T08:17:25+00:00

Using Python26 on Windows 7 and latest webpy. I copied the basic example (http://webpy.appspot.com/)

  • 0

Using Python26 on Windows 7 and latest webpy.

I copied the basic example (http://webpy.appspot.com/) for setting up Web.py on GAE, and followed the instructions for compiling templates for use with GAE (http://webpy.org/cookbook/templates_on_gae), but after doing so still have the ImportError: No module named templates.

Just to be clear: There are lots of people who have had this problem, and the solution is to compile the templates. I did this; still the same error.

My implementation is here: https://bitbucket.org/rhiaro/gae-tutorial (in webpyworld directory).

My main file, code.py is:

from google.appengine.ext import db
import web

urls = (
'/', 'index',
'/note', 'note',
'/crash', 'crash'
)

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

class Note(db.Model):
content = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)

class index:
def GET(self):
    notes = db.GqlQuery("SELECT * FROM Note ORDER BY date DESC LIMIT 10")
    return render.index(notes)

class note:
def POST(self):
    i = web.input('content')
    note = Note()
    note.content = i.content
    note.put()
    return web.seeother('/')

class crash:
def GET(self):
    import logging
    logging.error('test')
    crash

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

def main():
app.cgirun()

if __name__ == '__main__':
  main() 

Compiling the templates as instructed has resulted in the correct __ init __.py in the templates folder. But still it won’t recognise it as a module.

The last part of the errors output:

path\to\webpyworld\code.py in ()
8 )
9 
10 render = web.template.render('templates/')
11 
12 class Note(db.Model):
render undefined, web = <module 'web' from 'D:\gaeTut\webpyworld\web\__init__.pyc'>, web.template = <module 'web.template' from 'D:\gaeTut\webpyworld\web\template.py'>, web.template.render = <class web.template.GAE_Render>
path\to\webpyworld\web\template.py in __init__(self=<web.template.GAE_Render instance>, loc='templates/', *a=(), **kw={})
1031         else:
1032             name = loc.rstrip('/').replace('/', '.')
1033             self.mod = __import__(name, None, None, ['x'])
1034 
1035         self.mod.__dict__.update(kw.get('builtins', TEMPLATE_BUILTINS))
self = <web.template.GAE_Render instance>, self.mod undefined, builtin __import__ = <built-in function __import__>, name = 'templates', builtin None = None

<type 'exceptions.ImportError'>: No module named templates 
  args = ('No module named templates',) 
  message = 'No module named templates'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:17:26+00:00Added an answer on June 1, 2026 at 8:17 am

    You’re specifying templates/ as a static_dir in app.yaml.

    This means it will not be available to application code, but will only be served directly in response to direct requests for the templates themselves by the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I plan to use wsgi + mako in Windows. I install mako using C:\wsgi>c:\Python26\Scripts\easy_install.exe
I have been learning Python2.7 for a little bit now. I'm using Windows 7
I'm running Windows 7, Python 2.6.4 and the latest version of Eclipse. I downloaded
I've been using Cygwin on Windows recently. I want to use the Windows installation
I am using Windows 7 64 bit. I have these imports from scikits.audiolab import
Has anyone tried compiling SciPy 0.7.1 on Windows using numpy-1.3.0 that was built with
i have installed lxml2.2.2 on windows platform(i m using python version 2.6.5).i tried this
I'm trying to connect to my phone from my Windows 7 PC using PySerial
I'm trying to create a custom TCP stack using Python 2.6.5 on Windows 7
I just downloaded Scrapy (web crawler) on Windows 32 and have just created a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.