def _setup(self):
# Check local_host with settings.STATIC_URL
if self['local_host'] is not None:
if settings.STATIC_URL is None:
raise ValueError("The local_host item requires a no-empty settings.STATIC_URL.")
if not self['local_host'].startswith('{STATIC_URL}') and not self['local_host'].startswith(
settings.STATIC_URL):
raise ValueError('The local_host must start with the value of settings.STATIC_URL"')
if self['lib_js_host'] == 'local_host':
self['lib_js_host'] = self['local_host']
if self['map_js_host'] == 'local_host':
self['map_js_host'] = self['local_host']
if settings.STATIC_URL is not None:
self._host_context.update({'STATIC_URL': settings.STATIC_URL})
self._host_store = HostStore(
echarts_lib_name_or_host=self['lib_js_host'],
echarts_map_name_or_host=self['map_js_host'],
context=self._host_context
)
评论列表
文章目录