BAE tornado部署

python-web, python-worker选择

若是用于web访问,选择python-web。 其余,可选python-worker。python

构建tornado的framework

  1. 建立requirements.txt 文件,将 tornado==4.2 添加到文件中(不然,会出现import错误)。
  2. 建立tornado application。
   
   
   
   
import tornado.wsgi import tornado.web class MainHandler(tornado.web.RequestHandler): def __init__ (self): self.write( " Welcome to Tornado website. " ) app = tornado.wsgi.WSGIApplication([ (r " / " , MainHandler), ]) from bae.core.wsgi import WSGIApplication application = WSGIApplication(app)

将本地mongo数据库同步到BAE mongo数据中:

  1. 将本地数据导出:mongodump –o /home/yy/Share/mongo/
  2. 将数据压缩成zip文件
  3. 将文件上传到BOS
  4. 将数据文件从BOS导入到BAE mongo中
相关文章
相关标签/搜索