如何部署在AWS弹性魔豆结构瓶的应用程序 [英] How to deploy structured Flask app on AWS elastic beanstalk

查看:181
本文介绍了如何部署在AWS弹性魔豆结构瓶的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在成功部署使用的步骤的测试程序概述在这里: 的http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_flask.html

After successfully deploying a test app using the steps outlined here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_flask.html

我试图部署我实际烧瓶应用程序,它具有下列结构:

I tried to deploy my actual flask application which has the following structure:

myApp/
   runServer.py
   requirements.txt
   myApp/
      __init__.py
      helpers.py
      clean.sh
      static/
         myApp.css
      handlers/
         __init__.py
         views.py
      templates/
         layout.html
         viewOne.html
         viewTwo.html

其中, views.py 包含我的网址映射。

Where views.py contains my url mappings.

我试图初始化在根目录下的 EB 实例还有对myApp 模块内和混帐aws.push ,但我得到的AWS仪表盘下面的错误: 错误您WSGIPath指的是不存在的文件。键,应用程序无法正常工作(404任何路径)。

I have tried initializing the eb instance in the root directory as well as within the myApp module and git aws.push but I get the following error on the AWS dashboard: ERROR Your WSGIPath refers to a file that does not exist. and the application does not work (404 for any path).

我如何可以部署上述应用程序弹性魔豆?

How can I deploy the above Flask application to elastic beanstalk?

推荐答案

以下内容添加到 .ebextensions /< ENV-名称>的.config

option_settings:
  "aws:elasticbeanstalk:container:python":
    WSGIPath: myApp/handlers/views.py

更新:

如果您还没有.ebextensions目录,请创建一个项目。你可以找到可以做什么就在定制的容器配置和配置AWS弹性的更多信息魔豆环境指南。

If you don't have .ebextensions directory, please create one for the project. You can find more information of what can be done regarding the container configuration in Customizing and Configuring AWS Elastic Beanstalk Environments guide.

这篇关于如何部署在AWS弹性魔豆结构瓶的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆