hi everybody I need your help!
I have a problem that is tormenting me and driving me to madness, my
application suddenly stopped working, and gives me this error (changed
names and passwords for security reasons):
----------------------------------------------------------------------------------------------------------------
ERROR MESSAGE:
web2py™ Version 1.89.5 (2010-11-21 22:12:54)
Python Python 2.6.6: C:\Python26\python.exe
Traceback (most recent call last):
File "C:\web2py_1_89_5\gluon\restricted.py", line 188, in restricted
exec ccode in environment
File "C:/web2py_1_89_5/applications/snow/models/db.py", line 39, in
<module>
db = DAL('postgres://username:pass@'+host_name+':5432/snow')
# if not, use SQLite or other DB
File "C:\web2py_1_89_5\gluon\sql.py", line 4073, in DAL
raise RuntimeError, "%s (tried 5 times)" % exception
RuntimeError: 'module' object has no attribute 'connect' (tried 5
times)
----------------------------------------------------------------------------------------------------------------------
MY CODE:
import os
db_host_name='newhost'
db_computer_name='NEWHOST'
local_computer_name=os.getenv('COMPUTERNAME')
host_name=('localhost' if local_computer_name==db_computer_name else
db_host_name)
if request.env.web2py_runtime_gae: # if running on Google
App Engine
db = DAL('gae') # connect to Google
BigTable
session.connect(request, response, db = db) # and store sessions
and tickets there
### 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
db = DAL('postgres://username:pass@'+host_name+':5432/snow')
# if not, use SQLite or other DB
----------------------------------------------------------------------------------------------------------------
the crazy thing is the same application code, when run on my local
computer with my web2py local server - it's working!
only on the server itself there is a problem, it's like there is a
problem with the postgresql database & web2py server running on the
same machine
I tried to go back to a version of the application that I know for
sure that was working before, and it doesn't work either! it seems
that the fault is not in the application code but outside
somewhere...?
does anybody has an idea what the problem could be? maybe it has
something to do with the psycopg2 module?
please help!! any suggestion will be very appreciated!