[webpy] Problem when use webpy auth

6 views
Skip to first unread message

SearchDream

unread,
Apr 28, 2010, 9:54:28 PM4/28/10
to web.py
Hi all:
Anyone have tried http://jpscaletti.com/webpy_auth/
I use it like the following code, but always got 404 Not found error
on " /login " .

import web
from web.contrib.auth import DBAuth

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

app = web.application(urls, locals())
db = web.database(dbn='mysql', db='xxxxx', user='xxxxx', pw='xxxxx')
settings = {}

auth = DBAuth(app, db, **settings)

class index:
@auth.protected()
def GET(self):
return 'Hello World!'

if __name__ == "__main__":
app.run()

--
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to we...@googlegroups.com.
To unsubscribe from this group, send email to webpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webpy?hl=en.

Reply all
Reply to author
Forward
0 new messages