(dp1 S'output' p2 S'' sS'layer' p3 S'/home/camdpams_www/Products_Activation/applications/welcome/models/db.py' p4 sS'code' p5 S'# -*- coding: utf-8 -*-\n# this file is released under public domain and you can use without limitations\n\n#########################################################################\n## This scaffolding model makes your app work on Google App Engine too\n#########################################################################\n\nif request.env.web2py_runtime_gae: # if running on Google App Engine\n db = DAL(\'google:datastore\') # connect to Google BigTable\n # optional DAL(\'gae://namespace\')\n session.connect(request, response, db = db) # and store sessions and tickets there\n ### or use the following lines to store sessions in Memcache\n # from gluon.contrib.memdb import MEMDB\n # from google.appengine.api.memcache import Client\n # session.connect(request, response, db = MEMDB(Client()))\nelse: # else use a normal relational database\n db = DAL(\'sqlite://storage.sqlite\') # if not, use SQLite or other DB\n## if no need for session\n# session.forget()\n\n#########################################################################\n## Here is sample code if you need for\n## - email capabilities\n## - authentication (registration, login, logout, ... )\n## - authorization (role based authorization)\n## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)\n## - crud actions\n## (more options discussed in gluon/tools.py)\n#########################################################################\n\nfrom gluon.tools import *\nmail = Mail() # mailer\nauth = Auth(globals(),db) # authentication/authorization\ncrud = Crud(globals(),db) # for CRUD helpers using auth\nservice = Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc\nplugins = PluginManager()\n\nmail.settings.server = \'logging\' or \'smtp.gmail.com:587\' # your SMTP server\nmail.settings.sender = \'you@gmail.com\' # your email\nmail.settings.login = \'username:password\' # your credentials or None\n\nauth.settings.hmac_key = \'\' # before define_tables()\nauth.define_tables() # creates all needed tables\nauth.settings.mailer = mail # for user email verification\nauth.settings.registration_requires_verification = False\nauth.settings.registration_requires_approval = False\nauth.messages.verify_email = \'Click on the link http://\'+request.env.http_host+URL(\'default\',\'user\',args=[\'verify_email\'])+\'/%(key)s to verify your email\'\nauth.settings.reset_password_requires_verification = True\nauth.messages.reset_password = \'Click on the link http://\'+request.env.http_host+URL(\'default\',\'user\',args=[\'reset_password\'])+\'/%(key)s to reset your password\'\n\n#########################################################################\n## If you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.\n## register with janrain.com, uncomment and customize following\n# from gluon.contrib.login_methods.rpx_account import RPXAccount\n# auth.settings.actions_disabled=[\'register\',\'change_password\',\'request_reset_password\']\n# auth.settings.login_form = RPXAccount(request, api_key=\'...\',domain=\'...\',\n# url = "http://localhost:8000/%s/default/user/login" % request.application)\n## other login methods are in gluon/contrib/login_methods\n#########################################################################\n\ncrud.settings.auth = None # =auth to enforce authorization on crud\n\n#########################################################################\n## Define your tables below (or better in another model file) for example\n##\n## >>> db.define_table(\'mytable\',Field(\'myfield\',\'string\'))\n##\n## Fields can be \'string\',\'text\',\'password\',\'integer\',\'double\',\'boolean\'\n## \'date\',\'time\',\'datetime\',\'blob\',\'upload\', \'reference TABLENAME\'\n## There is an implicit \'id integer autoincrement\' field\n## Consult manual for more options, validators, etc.\n##\n## More API examples for controllers:\n##\n## >>> db.mytable.insert(myfield=\'value\')\n## >>> rows=db(db.mytable.myfield==\'value\').select(db.mytable.ALL)\n## >>> for row in rows: print row.id, row.myfield\n#########################################################################\n' p6 sS'snapshot' p7 (dp8 sS'traceback' p9 S'Traceback (most recent call last):\n File "/home/camdpams_www/Products_Activation/gluon/restricted.py", line 181, in restricted\n exec ccode in environment\n File "/home/camdpams_www/Products_Activation/applications/welcome/models/db.py", line 17, in ?\n db = DAL(\'sqlite://storage.sqlite\') # if not, use SQLite or other DB\n File "/home/camdpams_www/Products_Activation/gluon/dal.py", line 3720, in __init__\n raise RuntimeError, "Failure to connect, tried 5 times:\\n%s" % error\nRuntimeError: Failure to connect, tried 5 times:\nglobal name \'sqlite3\' is not defined\n' p10 s.