首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

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

2013-04-02 
解决基于BAE python+bottle开发上的一系列问题1、使用bottle的配置问题#-*- coding:utf-8 -*-import depend

解决基于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


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

热点排行