我的Flask应用程序有以下设置:
├── app
│ ├── __init__.py
│ └── routes.py
├── application.py
└── zappa_settings.jsonapplication.py
import os
from app import config_app
if __name__ == "__main__":
application = config_app(os.environ, __name__)
application.run(threaded=True)app/__init__.py
from flask import Flask
def config_app(config, name=__name__):
app = Flask(__name__)
app.config.from_mapping(config)
...
return app现在,我正在尝试将使用zappa的应用程序部署到亚马逊网络服务。当运行zappa init时,它会提示输入app_function,但是我不能完全确定要将其设置为什么。到目前为止我已经试过了
"app_function": "application.application"这将在最后返回一个502错误。
运行zappa tail
Traceback (most recent call last):
File "/var/task/handler.py", line 567, in lambda_handler
return LambdaHandler.lambda_handler(event, context)
File "/var/task/handler.py", line 237, in lambda_handler
handler = cls()
File "/var/task/handler.py", line 132, in __init__
wsgi_app_function = getattr(self.app_module, self.settings.APP_FUNCTION)
AttributeError: module 'application' has no attribute 'application'https://stackoverflow.com/questions/51473971
复制相似问题