[Fixed]-Django : dynamically added image is not showing

1👍

That’s because you can’t use django template tags in separate javascript file – they are only working within django template. So as workaround you could define variable in your template (of course within script tag)

var logoURL = {% static 'img/logo.png' %};

and then use it in your javascript file whenever you need it.

Leave a comment