Example #1
0
# create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)

# configure email
mail = auth.settings.mailer
mail.settings.server ='logging' if request.is_local else myconf.get('smtp.server')
mail.settings.sender ='logging' if request.is_local else myconf.get('smtp.sender')
mail.settings.login ='******' if request.is_local else myconf.get('smtp.login')
mail.settings.tls = True
mail.settings.ssl = False


# configure auth policy
auth.next = None
auth.navbar(referrer_actions=None)
auth.settings.registration_requires_verification = True
auth.messages.email_sent = "A verification email has been sent to you! Follow it's link to proceed."
auth.messages.verify_email_subject = 'Verify your account with ResearchConnect'
#auth.messages.verify_email = 'Thanks for signing up with ResearchConnect! We hope you look forward to connecting with professors and finding the research project you have been searching for. But first, we need you to follow this link'  https://toasthater.pythonanywhere.com/ResearchConnect/default/verify_email/%(key)s
auth.settings.login_next = URL('main')
auth.settings.register_next = URL('index')
auth.settings.create_user_groups = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_next = URL('../index')
auth.settings.request_reset_password_next = URL('../index')
auth.settings.reset_password_requires_verification = True
auth.settings.register_verify_password = False
auth.add_group('professor','professor permissions')
auth.add_group('student','student permissions')
#student_group = auth.add_group('student','group that has student permissions')