I've been like an hour searching how to reference static files in django, but I only found how to do it in templates. In my project, I succeeded in referencing static files in my templates, but I DON'T want to do it in templates, I want to do it in my .py files.
I think that i have to import static from somewere, I've tried with this:
from django.templatetags.static import static
from django.conf.urls.static import static
And trying to reference it like this
'<a href=/url> <img src="{{ STATIC_URL }}image.png" ></a>'
I've tried all possible combinations like
{% static image.png %}
{{static image.png}}
and so on...
Thanks!