Hi Anthony, When I say 'sometimes Web2py fails to create Auth tables and other times it does', I mean running a test procedure like this:
1. if 'mydb' already exists, it is dropped from PostgreSQL server using 'dropdb mydb' 2. a fresh 'mydb' is created using 'createdb mydb' 3. then run the Web2py In other words, every time when I run the test there is a fresh database 'mydb' in place with no table. So I would expect Web2py create all the necessary Auth tables upon the execution of 'auth.define_tables()'. 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. FYI, I am running PostgreSQL 9.1 and latest stable Web2py 1.99.7 with the following db drivers available: SQLite3, pymysql, psycopg2, pg8000, IMAP. 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 = 'some.em...@gmail.com' 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!