> > I just tried another test, I delete the whole app using Web2py appadmin, > and re-create it from scratch. And it worked for > auth.settings.create_user_groups = False > part with all the Auth tables created for the first test, though > verification email is still not sent. However, after I drop and re-create > the database 'mydb' as above, and re-run the same Web2py app, the error > comes back and none of the Auth tables gets created. >
If you drop the entire db (not using web2py), you should delete all the /databases/*.table files -- there is one such file for each table containing metadata about that table (based on migrations done by web2py). If you make changes to the db from outside web2py, those files will no longer be consistent with the state of the db. When you drop the whole db, just delete those files. > The syntax error in the email message code is due to post editing, whereas > in the code I check that there is no extra space after '\'. Does it matter > where I put the chunk of email-related code inside my model file, by which > I mean: > > ## configure email > > mail = auth.settings.mailer > mail.settings.server = 'smtp.gmail.com:587' > mail.settings.sender = '[email protected]' > mail.settings.login = 'some.email:123456' > > ## set the content of the verification email > auth.messages.verify_email = 'Please click on the link: http://' + \ > request.env.http_host + \ > URL(r=request,c='account',f='verify_email') + \ > '/%(key)s to verify your email address' > > > I put them before 'auth.define_tables()', not sure if that would affect > anything or not. Thanks a lot! > I ran your exact code, and it worked fine for me. If the email sending fails, the register function should rollback the db transaction (so you shouldn't see a new record in the db), and it should set response.flash to auth.messages.unable_send_email. Are you sure no email is being sent? Maybe it's getting flagged as spam. Anthony

