|
39 | 39 | 'django.contrib.staticfiles',
|
40 | 40 |
|
41 | 41 | 'channels',
|
| 42 | + 'bootstrap4', |
42 | 43 |
|
43 | 44 | 'django_plotly_dash.apps.DjangoPlotlyDashConfig',
|
44 | 45 | ]
|
|
126 | 127 | STATIC_ROOT = os.path.join(BASE_DIR,'static')
|
127 | 128 |
|
128 | 129 | STATICFILES_DIRS = [
|
| 130 | + os.path.join(BASE_DIR,'demo','static'), |
129 | 131 | ]
|
130 | 132 |
|
131 |
| -import dash_core_components as dcc |
132 |
| -_rname = os.path.join(os.path.dirname(dcc.__file__),'..') |
133 |
| -for dash_module_name in ['dash_core_components', |
134 |
| - 'dash_html_components', |
135 |
| - 'dash_renderer',]: |
136 |
| - STATICFILES_DIRS.append( ("dash/%s"%dash_module_name, os.path.join(_rname,dash_module_name)) ) |
| 133 | +# In order to serve dash components locally - not recommended in general, but |
| 134 | +# can be useful for development especially if offline - we add in the root directory |
| 135 | +# of each module. This is a bit of fudge and only needed if serve_locally=True is |
| 136 | +# set on a DjangoDash instance. |
| 137 | + |
| 138 | +if DEBUG: |
| 139 | + |
| 140 | + import dash_core_components as dcc |
| 141 | + _rname = os.path.join(os.path.dirname(dcc.__file__),'..') |
| 142 | + |
| 143 | + for dash_module_name in ['dash_core_components', |
| 144 | + 'dash_html_components', |
| 145 | + 'dash_renderer', |
| 146 | + 'dpd_components',]: |
| 147 | + STATICFILES_DIRS.append( ("dash/%s"%dash_module_name, os.path.join(_rname,dash_module_name)) ) |
137 | 148 |
|
138 |
| -# Fudge to work with channels in debug mode |
139 |
| -STATICFILES_DIRS.append(("dash/dpd_components","/home/mark/local/dpd-components/lib")) |
|
0 commit comments