Hai all,
I am learning web2py. In db.py I activate/create auth_user tables. But
it seemed that web2py failed to generate needed tables.
Here is my db.py
if request.env.web2py_runtime_gae: # if running on Google App Engine
from gluon.contrib.gql import *
### connect to Google BigTable
db = GQLDB()
## and store sessions and tickets there
session.connect(request, response, db=db)
### or use the following lines to store sessions in Memcache
# from gluon.contrib.memdb import MEMDB
# from google.appengine.api.memcache import Client
# session.connect(request, response, db=MEMDB(Client()))
else: # else use a normal relational database
# if not, use SQLite or other DB
#db = SQLDB('sqlite://storage.sqlite')
db = SQLDB('mysql://user:userpas...@localhost/happo', pool_size=0)
from gluon.tools import *
auth=Auth(globals(),db) # authentication/authorization
auth.define_tables() # creates all needed tables
crud=Crud(globals(),db) # for CRUD helpers using auth
service=Service(globals()) # for json, xml, jsonrpc, xmlrpc, amfrpc
## uncomment as necessary or consult docs for more options
crud.settings.auth=auth # (optional) enforces authorization on crud
mail=Mail() # mailer
mail.settings.server='smtp.gmail.com:587' # your SMTP server
mail.settings.sender='[email protected]' # your email
mail.settings.login='mico.siahaan:gmaipass' # your credentials
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://127.0.0.1:8000/customer/default/user/verify_email/%(key)s to
verify your email'
and here is the error:
Traceback (most recent call last):
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\restricted.py",
line 107, in restricted
exec ccode in environment
File
"C:/Users/mico/Documents/PERSONAL/Project/happo/src/trunk/web2py/applications/customer/controllers/appadmin.py",
line 255, in <module>
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\globals.py",
line 100, in <lambda>
self._caller = lambda f: f()
File
"C:/Users/mico/Documents/PERSONAL/Project/happo/src/trunk/web2py/applications/customer/controllers/appadmin.py",
line 104, in insert
if form.accepts(request.vars, session):
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\sqlhtml.py",
line 709, in accepts
onvalidation,
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 1122, in accepts
status = self._traverse(status)
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 439, in _traverse
newstatus = c._traverse(status) and newstatus
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 439, in _traverse
newstatus = c._traverse(status) and newstatus
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 439, in _traverse
newstatus = c._traverse(status) and newstatus
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 439, in _traverse
newstatus = c._traverse(status) and newstatus
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 446, in _traverse
newstatus = self._validate()
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\html.py",
line 935, in _validate
(value, errors) = validator(value)
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\validators.py",
line 305, in __call__
rows = self.dbset(field == value).select(limitby=(0, 1))
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\sql.py",
line 2120, in select
r = response(query)
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\sql.py",
line 2115, in response
self._db._execute(query)
File
"C:\Users\mico\Documents\PERSONAL\Project\happo\src\trunk\web2py\gluon\sql.py",
line 730, in <lambda>
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
File "C:\Python25\Lib\site-packages\MySQLdb\cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "C:\Python25\Lib\site-packages\MySQLdb\connections.py", line
35, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, "Table 'happo.auth_user' doesn't exist")
Is it a bug in 1.65.0?
--
Mico Siahaan
---
Email: [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---