简体   繁体   English

将 Dash 应用程序部署到 Azure - 应用程序 object 必须是可调用的

[英]Deploying Dash app to Azure - Application object must be callable

I am getting an issue with deploying my dash app to azure.我在将仪表板应用程序部署到 azure 时遇到问题。

I've named the file application.py and I have the following at the start of my code, what else am I missing?我已将文件命名为 application.py,并且在代码的开头有以下内容,我还缺少什么?

app = dash.Dash()
server = app.server
2020-07-15T02:10:24.794459675Z A P P   S E R V I C E   O N   L I N U X
2020-07-15T02:10:24.794463776Z 
2020-07-15T02:10:24.794467576Z Documentation: http://aka.ms/webapp-linux
2020-07-15T02:10:24.794471676Z Python 3.7.7
2020-07-15T02:10:24.794475676Z Note: Any data outside '/home' is not persisted
2020-07-15T02:10:25.516192798Z Starting OpenBSD Secure Shell server: sshd.
2020-07-15T02:10:25.598758328Z App Command Line not configured, will attempt auto-detect
2020-07-15T02:10:25.599342840Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -bindPort 8000
2020-07-15T02:10:26.005607153Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2020-07-15T02:10:26.017403300Z Build Operation ID: |dIT9rOZuwzA=.7809ead2_
2020-07-15T02:10:26.035129571Z Oryx Version: 0.2.20200522.2, Commit: bf724c0e83f3da74487f55cd304c63331dab7067, ReleaseTagName: 20200522.2
2020-07-15T02:10:27.985241432Z Detected an app based on Flask
2020-07-15T02:10:28.468481213Z Generating `gunicorn` command for 'application:app'
2020-07-15T02:10:29.130746361Z Writing output script to '/opt/startup/startup.sh'
2020-07-15T02:10:29.846009569Z Found virtual environment .tar.gz archive.
2020-07-15T02:10:29.846799084Z Removing existing virtual environment directory /antenv...
2020-07-15T02:10:29.888516619Z Extracting to directory /antenv...
2020-07-15T02:11:09.888367018Z Using packages from virtual environment antenv located at /antenv.
2020-07-15T02:11:09.971225254Z Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages'
2020-07-15T02:11:12.262498667Z [2020-07-15 02:11:12 +0000] [42] [INFO] Starting gunicorn 20.0.4
2020-07-15T02:11:12.265001320Z [2020-07-15 02:11:12 +0000] [42] [INFO] Listening at: http://0.0.0.0:8000 (42)
2020-07-15T02:11:12.265446929Z [2020-07-15 02:11:12 +0000] [42] [INFO] Using worker: sync
2020-07-15T02:11:12.282967396Z [2020-07-15 02:11:12 +0000] [45] [INFO] Booting worker with pid: 45
2020-07-15T02:11:18.319408889Z Application object must be callable.
2020-07-15T02:11:18.320327008Z [2020-07-15 02:11:18 +0000] [45] [INFO] Worker exiting (pid: 45)
2020-07-15T02:11:18.640154710Z [2020-07-15 02:11:18 +0000] [42] [INFO] Shutting down: Master
2020-07-15T02:11:18.640571018Z [2020-07-15 02:11:18 +0000] [42] [INFO] Reason: App failed to load.
2020-07-15T02:11:20.084Z ERROR - Container regionals3_0_1ebe0cd6 for site regionals3 has exited, failing site start
2020-07-15T02:11:20.162Z ERROR - Container regionals3_0_1ebe0cd6 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

Based on this line in your error log根据错误日志中的这一行

2020-07-15T02:10:28.468481213Z Generating `gunicorn` command for 'application:app'

it seems that the generated gunicorn command expects the Flask server to be named app .似乎生成的 gunicorn 命令期望 Flask 服务器被命名为app Hence if you change you code to因此,如果您将代码更改为

dash_app = dash.Dash()
app = dash_app.server

i guess it should work.我想它应该工作。 Alternatively, you would have to change the (generated) gunicorn command to application:server .或者,您必须将(生成的) gunicorn 命令更改为application:server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dash/Flask Python 应用程序 Azure 部署:应用程序 object 必须是可调用的 - Dash/Flask Python App Azure Deployment: Application object must be callable 在 Azure 中部署 Dash 应用程序,仍在加载中 - Deploying Dash app in Azure, remains Loading 部署 Dash 应用程序时出现 Heroku 应用程序错误 - Heroku Application Error when deploying Dash app 类型错误:'Dash' object 不可调用 - TypeError: 'Dash' object is not callable Gunicorn '应用程序 Object 必须可调用' 错误 - Gunicorn 'Application Object Must Be Callable' error Gunicorn 在 Flask 应用程序的服务器挂钩中出现“应用程序 object 必须是可调用的”失败,但前提是作为服务运行 - Gunicorn fails with "Application object must be callable" in server hook for Flask app, but only if run as service Gunicorn不会启动Flask应用程序因为“应用程序对象必须可调用” - Gunicorn won't start Flask app because “Application object must be callable” 将Dash应用程序部署到Azure时熊猫无法安装 - Pandas failing to install when deploying Dash app to Azure 将 Flask 应用程序部署到 Azure 应用程序服务 (Linux) - Deploying Flask Application to Azure App Servce (Linux) Azure - Python 短跑应用 - Azure - Python Dash Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM