utils.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:django-echarts 作者: kinegratii 项目源码 文件源码
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
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号