moved configuration of multi user mode to 0.py

This commit is contained in:
Massimo Di Pierro
2012-03-27 13:57:09 -05:00
parent 7c258a001a
commit 04d960840a
3 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.7 (2012-03-27 13:43:03) dev
Version 1.99.7 (2012-03-27 13:56:36) dev
+4 -1
View File
@@ -56,7 +56,10 @@ import os
GAE_APPCFG = os.path.abspath(os.path.join('/usr/local/bin/appcfg.py'))
# To use web2py as a teaching tool, set MULTI_USER_MODE to True
MULTI_USER_MODE = True
MULTI_USER_MODE = False
EMAIL_SERVER = 'localhost'
EMAIL_SENDER = 'professor@example.com'
EMAIL_LOGIN = None
# configurable twitterbox, set to None/False to suppress
TWITTER_HASH = "web2py"
+4 -8
View File
@@ -4,24 +4,20 @@
if MULTI_USER_MODE:
db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB
from gluon.tools import *
mail = Mail() # mailer
auth = Auth(globals(),db) # authentication/authorization
crud = Crud(globals(),db) # for CRUD helpers using auth
service = Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc
plugins = PluginManager()
mail.settings.server = 'logging' or 'smtp.gmail.com:587' # your SMTP server
mail.settings.sender = 'you@gmail.com' # your email
mail.settings.login = 'username:password' # your credentials or None
mail = auth.settings.mailer
mail.settings.server = EMAIL_SERVER
mail.settings.sender = EMAIL_SENDER
mail.settings.login = EMAIL_LOGIN
auth.settings.hmac_key = '<your secret key>' # before define_tables()
auth.define_tables() # creates all needed tables
auth.settings.mailer = mail # for user email verification
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = True
auth.messages.verify_email = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['verify_email'])+'/%(key)s to verify your email'
auth.settings.reset_password_requires_verification = True
auth.messages.reset_password = 'Click on the link http://'+request.env.http_host+URL('default','user',args=['reset_password'])+'/%(key)s to reset your password'
db.define_table('app',Field('name'),Field('owner',db.auth_user))