簡體   English   中英

為什么Dash應用程序無法在AWS Cloud9中預覽?

[英]Why does the Dash app not preview in AWS Cloud9?

嘗試在AWS Cloud9中查看Dash應用程序。 從Cloud9 docs( https://docs.c9.io/docs/run-an-application ),IP需要為0.0.0.0,並且唯一打開的端口為8000、8001和8002。

在run_server函數中設置這些端口,並嘗試將adhoc ssl與pyopenssl一起使用也無濟於事。

我正在從終端在python 3.6虛擬環境中運行文件。

import dash
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
    html.H1(children='Hello Dash'),

    html.Div(children='''
        Dash: A web application framework for Python.
    '''),

    dcc.Graph(
        id='example-graph',
        figure={
            'data': [
                {'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
                {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': 'Montreal'},
            ],
            'layout': {
                'title': 'Dash Data Visualization'
            }
        }
    )
])


if __name__ == '__main__':
    app.run_server(host='0.0.0.0', port=8000)

我仍然無法在Cloud9的預覽窗格中查看Dash應用程序。

有人知道解決方案嗎?

對於AWS Cloud9的預覽端口不同:8080、8081、8082。

有關更多信息,請參閱此文檔https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM