I am new to web2py. I downloaded the version 1.72.3. I have an error
directly at startup.
I do 'python web2py.py' to start the application server at the command
line.
I see this error page at http://127.0.0.1:8000/welcome/default/index:
Internal error
Ticket issued: welcome/127.0.0.1.2009-12-23.21-04-59.627a2785-
d15a-4911-818f-8b738f9b3732.
I have Python 2.6.4 running on OpenSuse 11.2 x86_64.
Is it the correct way to start the server? Do I need to build
something before?
-------------
Pierre
Anyway, please do the following:
- download 1.74.4 since it contains many bug fixes
- if you get a ticket again admin/<xxx> please check into web2py/
applications/admin/errors/<xxx> and post the content of that file. It
should tell us what is wrong.
Massimo
On Dec 23, 8:12 pm, pierreth <pierre.thibau...@gmail.com> wrote:
> Hello,
>
> I am new to web2py. I downloaded the version 1.72.3. I have an error
> directly at startup.
>
> I do 'python web2py.py' to start the application server at the command
> line.
>
> I see this error page athttp://127.0.0.1:8000/welcome/default/index:
I don't understand. Is it not suppose to be self-contain?
I made an install of SQL Lite 3 and I have the same error.
> Anyway, please do the following:
> - download 1.74.4 since it contains many bug fixes
OK, I am using this version now.
> - if you get a ticket again admin/<xxx> please check into web2py/
> applications/admin/errors/<xxx> and post the content of that file. It
> should tell us what is wrong.
Sorry but this is an empty directory.
Where to go from here?
-------------
Pierre
web2py/applications/welcome/errors/<xxx>
This may also be a file permission issue.
I have these two tickets:
(dp1
S'output'
p2
S''
sS'layer'
p3
S'/home/pierreth/T\xc3\xa9l\xc3\xa9chargement/web2py/applications/
welcome/models/db.py'
p4
sS'code'
p5
S"# -*- coding: utf-8 -*- \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('gae') #
connect to Google BigTable\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## comment/
uncomment as needed\n\nfrom gluon.tools import *\nauth=Auth(globals
(),db) # authentication/authorization
\nauth.settings.hmac_key='<your secret key>'\nauth.define_tables
() # creates all needed tables\ncrud=Crud
(globals(),db) # for CRUD helpers using auth
\nservice=Service(globals()) # for json, xml,
jsonrpc, xmlrpc, amfrpc\n\n#
crud.settings.auth=auth # enforces authorization
on crud\n# mail=Mail() # mailer\n#
mail.settings.server='smtp.gmail.com:587' # your SMTP server\n#
mail.settings.sender='y...@gmail.com' # your email\n#
mail.settings.login='username:password' # your credentials or None
\n# auth.settings.mailer=mail # for user email
verification\n# auth.settings.registration_requires_verification = True
\n# auth.settings.registration_requires_approval = True\n#
auth.messages.verify_email = \\\n# 'Click on the link
http://.../user/verify_email/%(key)s to verify your email'\n## more
options discussed in gluon/tools.py
\n#########################################################################
\n
\n#########################################################################
\n## Define your tables below, 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'traceback'
p7
S'Traceback (most recent call last):\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/restricted.py", line 173, in restricted
\n exec ccode in environment\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/applications/welcome/models/db.py", line 15,
in <module>\n db = DAL(\'sqlite://storage.sqlite\') # if not,
use SQLite or other DB\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 3670, in DAL\n return
SQLDB(uri, pool_size=pool_size, folder=folder, db_codec=db_codec)\n
File "/home/pierreth/T\xc3\xa9l\xc3\xa9chargement/web2py/gluon/
sql.py", line 883, in __init__\n self._pool_connection(lambda :
sqlite3.Connection(dbpath,\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 823, in _pool_connection
\n self._connection = f()\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 883, in <lambda>\n
self._pool_connection(lambda : sqlite3.Connection(dbpath,\nNameError:
global name \'sqlite3\' is not defined\n'
p8
s.
and this one:
(dp1
S'output'
p2
S''
sS'layer'
p3
S'/home/pierreth/T\xc3\xa9l\xc3\xa9chargement/web2py/applications/
welcome/models/db.py'
p4
sS'code'
p5
S"# -*- coding: utf-8 -*- \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('gae') #
connect to Google BigTable\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## comment/
uncomment as needed\n\nfrom gluon.tools import *\nauth=Auth(globals
(),db) # authentication/authorization
\nauth.settings.hmac_key='<your secret key>'\nauth.define_tables
() # creates all needed tables\ncrud=Crud
(globals(),db) # for CRUD helpers using auth
\nservice=Service(globals()) # for json, xml,
jsonrpc, xmlrpc, amfrpc\n\n#
crud.settings.auth=auth # enforces authorization
on crud\n# mail=Mail() # mailer\n#
mail.settings.server='smtp.gmail.com:587' # your SMTP server\n#
mail.settings.sender='y...@gmail.com' # your email\n#
mail.settings.login='username:password' # your credentials or None
\n# auth.settings.mailer=mail # for user email
verification\n# auth.settings.registration_requires_verification = True
\n# auth.settings.registration_requires_approval = True\n#
auth.messages.verify_email = \\\n# 'Click on the link
http://.../user/verify_email/%(key)s to verify your email'\n## more
options discussed in gluon/tools.py
\n#########################################################################
\n
\n#########################################################################
\n## Define your tables below, 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'traceback'
p7
S'Traceback (most recent call last):\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/restricted.py", line 173, in restricted
\n exec ccode in environment\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/applications/welcome/models/db.py", line 15,
in <module>\n db = DAL(\'sqlite://storage.sqlite\') # if not,
use SQLite or other DB\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 3670, in DAL\n return
SQLDB(uri, pool_size=pool_size, folder=folder, db_codec=db_codec)\n
File "/home/pierreth/T\xc3\xa9l\xc3\xa9chargement/web2py/gluon/
sql.py", line 883, in __init__\n self._pool_connection(lambda :
sqlite3.Connection(dbpath,\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 823, in _pool_connection
\n self._connection = f()\n File "/home/pierreth/T\xc3\xa9l
\xc3\xa9chargement/web2py/gluon/sql.py", line 883, in <lambda>\n
self._pool_connection(lambda : sqlite3.Connection(dbpath,\nNameError:
global name \'sqlite3\' is not defined\n'
p8
s.
It is very cryptic.
you can verify this by manually executing the following python:
$ python
>>> import sqlite3
If you get an error, that is your guide;
I just checked my ubuntu, and it only has Python 2.6.2;
I tried building Python 2.6.4, and got unexpected linux tests skipped
on linux: test_dbm (and also that build failed when I tried python:
import sqlite3).
My suggestion is that you stick to tested, distributed package of
python for your platform.
Suse 11.2 appears to distribute Python 2.6.2; stick with that:
http://software.opensuse.org/search?baseproject=openSUSE%3A11.2&p=1&q=python
Use the tested and released python for your platform; then you can
focus on / enjoy learning web2py.
Let us know how it goes!
Happy Holidays,
- Yarko
> mail.settings.sender='...@gmail.com' # your email\n#
> mail.settings.login='username:password' # your credentials or None
> \n# auth.settings.mailer=mail # for user email
> verification\n# auth.settings.registration_requires_verification = True
> \n# auth.settings.registration_requires_approval = True\n#
> auth.messages.verify_email = \\\n# 'Click on the linkhttp://.../user/verify_email/%(key)sto verify your email'\n## more
> mail.settings.sender='...@gmail.com' # your email\n#
> mail.settings.login='username:password' # your credentials or None
> \n# auth.settings.mailer=mail # for user email
> verification\n# auth.settings.registration_requires_verification = True
> \n# auth.settings.registration_requires_approval = True\n#
> auth.messages.verify_email = \\\n# 'Click on the linkhttp://.../user/verify_email/%(key)sto verify your email'\n## more
these tickets are not supposed to be machine readable and usually you
click on them and the web based IDE opens them nicely. In some rare
occasions like in your case the problem is not with the app but with
web2py itself and web2py may be unable to open the ticket.
Anyway the last part is a normal Python traceback escaped:
S'Traceback
... line 883, in <lambda>
self._pool_connection(lambda : sqlite3.Connection(dbpath,
NameError:global name \'sqlite3\' is not defined
as Yarko pointed out. We only need to look at this last line to see
the problem is.
Normally at startup, before you even open the browser, web2py lists
all the db drivers it found. sqlite should be there. You will find it
is not. If you installed it, it is possible you have different
versions of Python and you are not running web2py with the version of
Python that you used to install sqlite3. I suggest try to start web2py
by specifying explicitly a version of Python.
Massimo
On Dec 24, 5:09 pm, pierreth <pierre.thibau...@gmail.com> wrote:
> mail.settings.sender='...@gmail.com' # your email\n#
> mail.settings.login='username:password' # your credentials or None
> \n# auth.settings.mailer=mail # for user email
> verification\n# auth.settings.registration_requires_verification = True
> \n# auth.settings.registration_requires_approval = True\n#
> auth.messages.verify_email = \\\n# 'Click on the linkhttp://.../user/verify_email/%(key)sto verify your email'\n## more
> mail.settings.sender='...@gmail.com' # your email\n#
> mail.settings.login='username:password' # your credentials or None
> \n# auth.settings.mailer=mail # for user email
> verification\n# auth.settings.registration_requires_verification = True
> \n# auth.settings.registration_requires_approval = True\n#
> auth.messages.verify_email = \\\n# 'Click on the linkhttp://.../user/verify_email/%(key)sto verify your email'\n## more
It works perfectly well using the Python version of my
distribution. :-)
I wanted to install version 2.4, 2.5, 2.6 of Python to test my code
and later contribute to Web2Py.
Why do I need to do more than just build and install Python from the
source?
Here are the test results for my Python installations:
Python 2.4.6
251 tests OK.
40 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_bz2 test_cd test_cl test_codecmaps_cn
test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
test_codecmaps_tw test_curses test_dbm test_dl test_gdbm test_gl
test_imageop test_imgfile test_linuxaudiodev test_macfs
test_macostools test_nis test_normalization test_ossaudiodev
test_pep277 test_plistlib test_rgbimg test_scriptpackages
test_socket_ssl test_socketserver test_sunaudiodev test_tcl
test_timeout test_urllib2net test_urllibnet test_winreg
test_winsound
5 skips unexpected on linux2:
test_tcl test_dbm test_bz2 test_gdbm test_bsddb
Python 2.5.4
279 tests OK.
43 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_bz2 test_cd test_cl test_codecmaps_cn
test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
test_codecmaps_tw test_curses test_dbm test_dl test_gdbm test_gl
test_imageop test_imgfile test_linuxaudiodev test_macfs
test_macostools test_nis test_normalization test_ossaudiodev
test_pep277 test_plistlib test_rgbimg test_scriptpackages
test_socket_ssl test_socketserver test_sqlite test_startfile
test_sunaudiodev test_tcl test_timeout test_urllib2net
test_urllibnet test_winreg test_winsound test_zipfile64
5 skips unexpected on linux2:
test_tcl test_dbm test_bz2 test_gdbm test_bsddb
Python 2.6.4
323 tests OK.
42 tests skipped:
test_aepack test_al test_applesingle test_bsddb test_bsddb185
test_bsddb3 test_bz2 test_cd test_cl test_codecmaps_cn
test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
test_codecmaps_tw test_curses test_dbm test_dl test_gdbm test_gl
test_imageop test_imgfile test_kqueue test_linuxaudiodev
test_macos test_macostools test_normalization test_ossaudiodev
test_pep277 test_py3kwarn test_scriptpackages test_smtpnet
test_socketserver test_sqlite test_startfile test_sunaudiodev
test_tcl test_timeout test_urllib2net test_urllibnet test_winreg
test_winsound test_zipfile64
5 skips unexpected on linux2:
test_tcl test_dbm test_bz2 test_gdbm test_bsddb
What should I do to fix them? Just install the missing sqlite3? As you
said, sqlite seems to be installed only with the Python version of my
distribution.