On Mon, Feb 22, 2010 at 1:12 AM, flydutchman <[email protected]> wrote: > Hello, > > I'm a new comer. > I've install the Python, web.py and flup. I'm reading the Tutorial and > plan to run the 5-line application as follows: > ---------------------------------------------------------------- > import web > > urls = ( > '/', 'index' > ) > > app = web.application(urls, globals()) > > class index: > def GET(self): > return "Hello, world!" > > if __name__ == "__main__": app.run() > ---------------------------------------------------------------- > > However, when I run it as: python code.py, some error occurs. The > trace is: > ---------------------------------------------------------------- > Traceback (most recent call last): > File "/afs/informatik.uni-goettingen.de/user/t/txu/workspace/Test/ > src/Application/copy.py", line 3, in <module> > import web > File "/usr/local/lib/python2.6/dist-packages/web/__init__.py", line > 15, in <module> > import template, form > File "/usr/local/lib/python2.6/dist-packages/web/form.py", line 6, > in <module> > import copy, re > File "/afs/informatik.uni-goettingen.de/user/t/txu/workspace/Test/ > src/Application/copy.py", line 9, in <module> > app = web.application(urls, globals()) > AttributeError: 'module' object has no attribute 'application' > ---------------------------------------------------------------
Looks like your filename is code.py. web.py is trying to reload that module as code and Python is thinking that it is standard library module code. You can resolve this issue by either renaming your file or by adding "web.config.debug = False" after importing web to avoid reloading your module. -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
