Hello,

On Sat, Jan 23, 2010 at 11:19:07AM -0800, Dave Everitt wrote:
> Just trying out web.py but fell at the first hurdle. Here's how it
> went:
> easy_install web.py
> - gets me version 0.33.
> 
> I do the tutorial at http://webpy.org/tutorial2.en

The tutorial is for web.py 0.2, but you're using web.py 0.33. Things
have changed since 0.2, and one of them is the way the application is
made run.

> by making the executable file 'code.py':
> 
> import web
> 
> urls = (
>       '/', 'index',
>       '', 'index' )
> 
> class index:
>       def GET(self):
>               print "Hello Web.py"
> 
> if __name__ == "__main__": web.run(urls, globals())
> 
> run it:
>   python code.py
> 
> get this traceback:
> 
>   File "code.py", line 13, in <module>
>     if __name__ == "__main__": web.run(urls, globals())
> AttributeError: 'module' object has no attribute 'run'

This is what I was talking about. Here's the tutorial you want:
http://webpy.org/tutorial3.en

It explains the new way to make an application run.

Basically, you have to change that last line:

    if __name__ == "__main__": web.run(urls, globals())

to something like:

    if __name__ == "__main__":
        app = web.application(urls)
        app.run()

If you have any doubt, just ask again.

> 
> Background:
> I've been learning Django, but also messing with Ruby's Sinatra and
> Camping which gave me an appetite for something lighter. Having tried
> many other options, I've developed a developed a zero-tolerance for
> errors I can't solve quickly!

:)

Thanks,

-- 
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/

-- 
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.

Reply via email to