Django项目,用Jinja2模板渲染前端页面的时候报错’ConfiguredStorage’ object is not callable。
def jinja2_environment(**options):
env = Environment(**options)
env.globals.update({
'static': staticfiles_storagel,
'url': reverse,
})
return env
后面发现使用因为staticfiles_storagel后面没有“.url”,这个自定义模板取的就是当前项目的静态文件路径,因此改成staticfiles_storagel.url 才是正确的