如何配置我的AWS弹性魔豆WSGI应用程序的名称? [英] How do I configure the name of my WSGI application on AWS Elastic Beanstalk?

查看:263
本文介绍了如何配置我的AWS弹性魔豆WSGI应用程序的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Python Web应用程序被称为应用

My Python web application is called app

# example.py
import flask

app = flask.Flask(__name__.split('.')[0])

当我尝试使用启动它的AWS-EB

and when I attempt to launch it on AWS-EB using

# run.py (set correctly with WSGIPath)
from example import app

if __name__ == "__main__":
    app.run()

我收到

的mod_wsgi(PID = 22473):目标WSGI脚本/opt/python/current/app/run.py'不包含WSGI应用程序的应用程序

mod_wsgi (pid=22473): Target WSGI script '/opt/python/current/app/run.py' does not contain WSGI application 'application'.

如何我告诉AWS我的应用程序实例名为应用

How to I tell AWS that my application instance is called app?

推荐答案

mod_wsgi的预期变量名为应用程序。尝试做这样的事情

mod_wsgi expects variable called application. Try to do something like this

from example import app as application

请注意:不要做 application.run()。它是不需要的。

Note: don't do application.run(). It is not needed.

这篇关于如何配置我的AWS弹性魔豆WSGI应用程序的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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