SAE的Python数据库连接配置可以看这个地方http://appstack.sinaapp.com/static/doc/release/testing/service.html#mysql
使用web.py的话可以这样子
import sae
db = web.database(dbn='mysql', port=int(sae.const.MYSQL_PORT), host=sae.const.MYSQL_HOST, db=sae.const.MYSQL_DB, user=sae.const.MYSQL_USER, pw=sae.const.MYSQL_PASS)
需要注意的是端口需要转换成int,否则的话会出现:an integer is required错误
如果SAE只是出现:internal server error的话,建议打开web.py的调试,这样设置就行:
web.config.debug = True