[BUG]-Pages redirection doesn't on DE workspace
@T4rk1n 已经在做这个了。
开始于 2026年1月7日。
评估
这个 Issue 还没有评估数据。
描述
Describe your context
when using redirect_from in one of the pages it return 404 on the DE workspace, however, it works fine once the app is deployed.
dash 3.3.0
pages/overview.py
from dash import html
import dash
dash.register_page(
__name__,
title="New Home Page",
path="/overview",
redirect_from=['/home']
)
layout = html.Div([
html.H1('This is our Overview page'),
html.Div('This is our Overview page content.'),
])
app.py
import dash_mantine_components as dmc
import dash
from dash import dash, Dash, dcc
from dash_iconify import DashIconify
import os
from flask import redirect
app = Dash(__name__, use_pages=True)
server = app.server
logo = "2026_renewal_logo.svg"
def create_main_nav_link(icon, label, href):
return dcc.Link(
dmc.Group(
align='center',
gap=10,
style={'margin-bottom':5},
children=[
dmc.ThemeIcon(
DashIconify(icon=icon, width=36, color = 'white'),
size=48,
radius=5,
color='red',
variant="filled",
style={'margin-left':10}
),
dmc.Text(label, size="xl", c="gray", style={'font-family':'IntegralCF-Regular'}),
]
),
href=app.get_relative_path(href),
style={"textDecoration": "none"},
)
layout = dmc.AppShell(
[
dmc.AppShellNavbar(
id="navbar",
children=[
dmc.Center(
dmc.Image(src=app.get_asset_url(logo), h=280, flex=0),
),
dmc.Divider(),
create_main_nav_link('bi:speedometer2','Overview', '/overview')
],
p="md",
),
dmc.AppShellMain(dash.page_container),
],
navbar={
"width": 500,
"breakpoint": "sm",
"collapsed": {"mobile": True, "desktop": False},
},
padding="md",
id="appshell",
)
app.layout = dmc.MantineProvider(layout)
if __name__ == "__main__":
app.run(debug=True)
FYI: When I changed
fullnamefor the routes path it worked https://github.com/plotly/dash/blob/f7bb86624badf1d175dd596c6096138c2902c327/dash/_pages.py#L164
- 主要语言
- Python
- 星标
- 24.4k
- 派生
- 2.3k
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 19
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/dash 的其他 Issue
-
good first issue P3 size: 1 task
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement P2 size: 5
难度 5/5 一周以上 新手友好度 45/100
-
enhancement P3 size: 10+
-
P2 size: 1 task
-
enhancement P3 size: 1
难度 3/5 1-2 天 新手友好度 72/100
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·