def set_up_client():
# set up client with:
#
# set Twisted debug level
# connect to the db
global dbconn, dbd, dbpool
DEBUG_MODE = True
setDebugging(DEBUG_MODE)
log.startLogging(sys.stdout)
# db connection and deferred
dbconn = txpostgres.Connection()
dbd = dbconn.connect("dbname=news user=user password=test1 host=127.0.0.1 application_name='news-collect'")
dbpool = adbapi.ConnectionPool('psycopg2', dbname='news', user='user', password='test1')
评论列表
文章目录