0

I'd like to call the staticfiles static tag inside my view, or its equivalent. How can I do that?

What I've tried: nothing so far.

What I've found: a bunch of questions asking how to call a function inside a template, which is the exact opposite of what I want to do.

Marcin
  • 48,559
  • 18
  • 128
  • 201

1 Answers1

1
from django.contrib.staticfiles.storage import staticfiles_storage
staticfiles_storage.url(same_as_templatetag_argument)
Marcin
  • 48,559
  • 18
  • 128
  • 201