# Author: Alex Ksikes import web from app.helpers import utils from app.helpers import formatting # connect to database db = web.database(dbn='mysql', db='dbname', user='******', passwd='passwd', charset=None) # in development debug error messages and reloader web.config.debug = True # in develpment template caching is set to false cache = False # template global functions globals = utils.get_all_functions(formatting) # set global base template view = web.template.render('app/views', cache=cache, globals=globals) # in production the internal errors are emailed to us web.config.email_errors = ''
import web from app.helpers import misc from app.helpers import utils # connect to the mailer database. db = web.database(dbn='mysql', db='mailer', user='******', passwd='password') # in development debug error messages and reloader. web.config.debug = False # in develpment template caching is set to false. cache = True # global used template functions. globals = utils.get_all_functions(misc) # the domain where the site is hosted. site_domain = 'www.your_domain.com' # set global base template. view = web.template.render('app/views', cache=cache, globals=globals) # used as a salt. encryption_key = 'a random string' # in production the internal errors could be emailed to us. web.config.email_errors = '' # email of the sender. # IMPORTANT: make sure SPF and reverse DNS are setup to avoid mails being marked as spam.
# connect to database # ==============Online Product:============== # db = web.database(dbn='mysql', db='xxxxx', user='******', passwd='xxxxx') # ==============Product Dev:============== # db = web.database(dbn='mysql', db='xxxxx-dev', user='******', passwd='xxxxx') # ==============Local Dev:============== db = web.database(dbn="mysql", db="dbname", user="******", passwd="pwd") # in development debug error messages and reloader web.config.debug = True # in develpment template caching is set to false cache = False # global used template functions globals = utils.get_all_functions(misc) # the domain where to get the forms from # site_domain = 'http://0.0.0.0:8080'#本地开发测试用 site_domain = "xxxx" # 你的域名 # the site name where to get the forms from site_name = "xxxx" # 你的网站名称 # email settings # mail_sender = 'Biu <*****@*****.**>' #请填写你用来发邮件的gmail邮箱 mail_sender = None # 请填写你用来发邮件的gmail邮箱 # set global base template view = web.template.render("app/views", cache=cache, globals=globals)
import web import cgi from app.helpers import utils, formatting db = web.database(dbn='mysql', db='compiler', user='******', passwd='miku', charset=None) cache = False web.config.debug = True # template global functions globals_ = utils.get_all_functions(formatting) # set global base template view = web.template.render('app/views', cache=cache, globals=globals_) # Maximum input we will accept when REQUEST_METHOD is POST # 0 ==> unlimited input cgi.maxlen = 10 * 1024 * 1024 # 10MB