读书人

解决基于BAE python+bottle开发上的一

发布时间: 2013-04-02 12:35:26 作者: rapoo

解决基于BAE python+bottle开发上的一系列问题

1、使用bottle的配置问题

#-*- coding:utf-8 -*-
import depend.app
from depend.bottle import Bottle,debug, run

from action import root

# def app(environ, start_response):
# status = '200 OK'
# headers = [('Content-type', 'text/html')]
# start_response(status, headers)
# body=["Welcome to Baidu Cloud!\n"]
# return body
#
# from bae.core.wsgi import WSGIApplication
# application = WSGIApplication(app)

if __name__ == '__main__':
# debug(True)
run(root, host="0.0.0.0", port=8081, reloader=True)
else:
# Mod WSGI launch
application = root

2、解决ImportError: Could not generate the error page. Please add bottle to the import path. 问题

解决方法:代码错误,查看“应用日志”进行修改

3、解决root.mount 的404错误问题

解决方法:"云环境(BAE)"--“代码管理”--“高级”--“配置” 添加

url/(.*)index.py 另见参考:http://godbae.duapp.com/?p=44


======================待更新========================

读书人网 >perl python

热点推荐