MCPcopy Index your code
hub / github.com/plotly/dash / get_asset_url

Method get_asset_url

dash/dash.py:1800–1828  ·  view source on GitHub ↗

Return the URL for the provided `path` in the assets directory. If `assets_external_path` is set, `get_asset_url` returns `assets_external_path` + `assets_url_path` + `path`, where `path` is the path passed to `get_asset_url`. Otherwise, `get_asset_url` ret

(self, path: str)

Source from the content-addressed store, hash-verified

1798 ]
1799
1800 def get_asset_url(self, path: str) -> str:
1801 """
1802 Return the URL for the provided `path` in the assets directory.
1803
1804 If `assets_external_path` is set, `get_asset_url` returns
1805 `assets_external_path` + `assets_url_path` + `path`, where
1806 `path` is the path passed to `get_asset_url`.
1807
1808 Otherwise, `get_asset_url` returns
1809 `requests_pathname_prefix` + `assets_url_path` + `path`, where
1810 `path` is the path passed to `get_asset_url`.
1811
1812 Use `get_asset_url` in an app to access assets at the correct location
1813 in different environments. In a deployed app on Dash Enterprise,
1814 `requests_pathname_prefix` is the app name. For an app called "my-app",
1815 `app.get_asset_url("image.png")` would return:
1816
1817 ```
1818 /my-app/assets/image.png
1819 ```
1820
1821 While the same app running locally, without
1822 `requests_pathname_prefix` set, would return:
1823
1824 ```
1825 /assets/image.png
1826 ```
1827 """
1828 return _get_paths.app_get_asset_url(self.config, path)
1829
1830 def get_relative_path(self, path):
1831 """

Callers 6

indexMethod · 0.95
_add_assets_resourceMethod · 0.95
_on_assets_changeMethod · 0.95
test_asset_urlFunction · 0.95
_page_meta_tagsFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_asset_urlFunction · 0.76