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


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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值