在新浪sae下部署python程序数据库配置问题 an integer is required
来源:互联网 发布:rpg游戏推荐 知乎 编辑:程序博客网 时间:2024/06/06 08:28
在新浪sae下部署python web应用和本地其实没有多大却别,也就是文件系统限制比较大。
新浪sae有提供mysql数据库。在使用python配置db的时候,出现了an integer is required错误。
新浪sae提供的mysql数据库有他定义好的链接信息,存在sae.const属性中,
import sae.const导入模块引用属性。
db = web.database(dbn='mysql', db=sae.const.MYSQL_DB, user=sae.const.MYSQL_USER, pw=sae.const.MYSQL_PASS, host=sae.const.MYSQL_HOST, port=int(sae.const.MYSQL_PORT) )
sae.const.MYSQL_DB #数据库名称
sae.const.MYSQL_USER #用户名
sae.const.MYSQL_PASS #密码
sae.const.MYSQL_HOST #域名
sae.const.MYSQL_PORT #端口
出现an integer is required错误的原因就是这个sae.const.MYSQL_PORT是一个字符串,只要使用int转换就可以使用。这个问题一开始还不知道,因为使用过很多提供数据库信息的模块,端口都是int属性,这个有点异同。
- 在新浪sae下部署python程序数据库配置问题 an integer is required
- python使用MySQLdb报an integer is required
- thinkphp在新浪SAE平台的部署
- thinkphp在新浪SAE平台的部署
- 在新浪sae中 配置smarty
- 新浪SAE云用python和web.py连接数据库的问题
- 新浪SAE平台服务器和数据库部署详解
- 新浪sae上php部署 应用配置及日志系统
- 新浪SAE链接数据库
- 在新浪SAE上部署应用实战心得
- MAVEN 部署编译问题(There is an error in invoking javac. A full JDK (not just JRE) is required)
- 新浪sae部署django1.4
- 新浪sae部署django1.4
- ThinkPHP项目在SAE下的部署
- 在新浪SAE上学习PHP - 1(连接MySQL数据库)
- Java web struts2项目在新浪SAE上传的问题
- 新浪云SAE 部署 flask程序详解 打包方式上传代码部署
- sae django+python部署
- 类加载工具--ClassUtil
- HDU 4503 湫湫系列故事——植树节
- 在您电脑的BIOS中启用 VT-x/AMD-V 支持
- 10 xargs command example in linux
- virtualbox+ubuntu设置共享文件夹
- 在新浪sae下部署python程序数据库配置问题 an integer is required
- vim 配色方案
- ZOJ 1004 Anagrams by Stack(dfs堆栈)
- PMA学习第一章
- 老公的忏悔(看了笑S你)
- 类加载器
- 信号量和自旋锁的使用
- Android NDK
- struts2中的利用结果类型实现Action协作(七)