Massimo, Let's start over. I went back to AlterEgo and redid my db.py
file from scratch. It now reads (comments omitted for brevity):
db = DAL('sqlite://storage.db') # if not, use SQLite or other DB
from gluon.tools import Mail, Auth, Crud # new in web2py 1.56
mail=Mail()
# mailer
mail.settings.server='smtp.gmail.com:587' # your SMTP server
mail.settings.sender='[email protected]' # your email
mail.settings.login='username:password' # your credentials
auth=Auth(globals(),db)
auth.settings.table_user = db.define_table(
auth.settings.table_user_name,
db.Field('first_name', length=128,default=''),
db.Field('last_name', length=128,default=''),
db.Field('email', length=128,default='',
requires=[
IS_EMAIL(),
IS_NOT_IN_DB(db,'%s.email'%auth.settings.table_user_name)
]
),
db.Field('password', 'password', readable=False,
label='Password', requires=CRYPT()),
db.Field('registration_key', length=128,
writable=False, readable=False,default=''),
)
auth.settings.captcha=Recaptcha
(request,public_key='RECAPTCHA_PUBLIC_KEY',private_key='RECAPTCHA_PRIVATE_KEY')
auth.define_tables() # creates all needed tables
crud=Crud(globals(),db) # for CRUD helpers using auth
crud.settings.auth=auth # (optional) enforces authorization on
crud
When I run this, I get:
NameError: name 'Recaptcha' is not defined
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---