File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""View for serving static assets under `/assets`."""
2
2
3
+ import os
3
4
import importlib_resources
4
5
from h_assets import Environment , assets_view
5
6
from pyramid .settings import asbool
6
7
7
8
9
+
8
10
def includeme (config ):
9
11
auto_reload = asbool (config .registry .settings .get ("h.reload_assets" , False ))
10
12
h_files = importlib_resources .files ("h" )
11
13
14
+ asset_path = "/hypothesis/assets"
15
+ if "ASSET_PATH" in os .environ :
16
+ asset_path = os .environ ["ASSET_PATH" ]
17
+
12
18
assets_env = Environment (
13
- assets_base_url = "/hypothesis/assets" ,
19
+ assets_base_url = asset_path ,
14
20
bundle_config_path = h_files / "assets.ini" ,
15
21
manifest_path = h_files / "../build/manifest.json" ,
16
22
auto_reload = auto_reload ,
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ setenv =
72
72
REPORT_FDW_USERS =lms-fdw report-fdw
73
73
dev: PYTHONPATH = .
74
74
dev: APP_URL = {env:APP_URL:http://localhost:5000}
75
+ dev: ASSET_PATH = {env:ASSET_PATH:/assets}
75
76
dev: WEBSOCKET_URL = {env:WEBSOCKET_URL:ws://localhost:5001/ws}
76
77
dev: ENABLE_WEB = {env:ENABLE_WEB:true}
77
78
dev: ENABLE_WEBSOCKET = {env:ENABLE_WEBSOCKET:true}
You can’t perform that action at this time.
0 commit comments