Used the proxied call to staticfiles_storage.url
This commit is contained in:
parent
9ab798a8d8
commit
a42e04f77d
|
@ -5,11 +5,15 @@ from django.contrib.staticfiles.storage import staticfiles_storage
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
def static(path):
|
||||||
|
return staticfiles_storage.url(path)
|
||||||
|
|
||||||
|
|
||||||
class StaticFilesNode(StaticNode):
|
class StaticFilesNode(StaticNode):
|
||||||
|
|
||||||
def url(self, context):
|
def url(self, context):
|
||||||
path = self.path.resolve(context)
|
path = self.path.resolve(context)
|
||||||
return staticfiles_storage.url(path)
|
return static(path)
|
||||||
|
|
||||||
|
|
||||||
@register.tag('static')
|
@register.tag('static')
|
||||||
|
@ -31,7 +35,3 @@ def do_static(parser, token):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return StaticFilesNode.handle_token(parser, token)
|
return StaticFilesNode.handle_token(parser, token)
|
||||||
|
|
||||||
|
|
||||||
def static(path):
|
|
||||||
return staticfiles_storage.url(path)
|
|
||||||
|
|
Loading…
Reference in New Issue