添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
from settings import DATABASE_WAIT_TIMEOUT except ImportError : print u 'DATABASE_WAIT_TIMEOUT not in settings.py, defaulting to 120.' DATABASE_WAIT_TIMEOUT = 120 import sqlalchemy.pool as pool Database = pool . manage ( Database , recycle = DATABASE_WAIT_TIMEOUT - 1 ) # must match or be less than wait_timeout in mysql if settings . DATABASE_HOST . startswith ( '/' ): self . connection = Database . connect ( port = kwargs [ 'port' ], unix_socket = kwargs [ 'unix_socket' ], user = kwargs [ 'user' ], db = kwargs [ 'db' ], passwd = kwargs [ 'passwd' ], use_unicode = kwargs [ 'use_unicode' ], charset = 'utf8' ) else : self . connection = Database . connect ( host = kwargs [ 'host' ], port = kwargs [ 'port' ], user = kwargs [ 'user' ], db = kwargs [ 'db' ], passwd = kwargs [ 'passwd' ], use_unicode = kwargs [ 'use_unicode' ], charset = 'utf8' )