plotly / plotly/dash

handle assets and requests_pathname_prefix

Open
#489 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

So I currently have an API Gateway serving my Dash app under the /dev/ base path.
I have specified my Dash.dash app with

app.config.update({
    # as the proxy server will remove the prefix
    "routes_pathname_prefix": "/", 
    # the front-end will prefix this string to the requests
    # that are made to the proxy server
    'requests_pathname_prefix': '/dev/'
})

and most the app renders fine however, I noticed that the files in my assets directory are not being found since when the app loads, its looking in /assets/ instead of /dev/assets.

This seems like a quick fix on my part, but I'm not sure where to start since this library is so new to me.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Dash app behind an API Gateway at the /dev/ base path using the shown routes_pathname_prefix and requests_pathname_prefix settings. Trace how the assets directory URLs are generated and verify that asset requests use /dev/assets while the existing root-path behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.