Код: Выделить всё
import dash
from dash import html
import dash_bootstrap_components as dbc
from utils.b2b_db import init_db
# Initialize the Dash app with Bootstrap theme
app = dash.Dash(
__name__,
use_pages=True, # Enable multi-page support
external_stylesheets=[dbc.themes.BOOTSTRAP],
suppress_callback_exceptions=True
)
# Initialize database
init_db()
# Create the navigation bar
navbar = dbc.Navbar(
dbc.Container([
dbc.NavbarBrand("ISP Analytics", href="/", className="ms-2"),
dbc.Nav([
dbc.NavLink(
[html.Div(page["name"])],
href=page["path"],
active="exact",
)
for page in dash.page_registry.values()
])
]),
color="dark",
dark=True,
className="mb-2"
)
# Layout
app.layout = html.Div([
navbar,
dash.page_container
])
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8050, debug=False)
< /code>
Я подтвердил, что: < /p>
[list]
[*] Мой брандмауэр отключен или допускает трафик на порту 8050. (venv) E:\ISP DASH>python app.py
Dash is running on http://0.0.0.0:8050/
Serving Flask app 'app'
Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Running on all addresses (0.0.0.0)
Running on http://127.0.0.1:8050
Running on http://10.233.233.158:8050 ```
[/list]
Как сделать это приложение доступным с другой машины в той же сети, используя локальный IP (например, 10.233.233.158:8050 )? Любая помощь будет оценена.
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/797 ... network-ip