I had static files in django.
Project Structure Sample
I have project structure like above i want to use js and img from asset folder. How can i do this ? How i can avoid using {% static "abc.jpg" %}
?
I had static files in django.
Project Structure Sample
I have project structure like above i want to use js and img from asset folder. How can i do this ? How i can avoid using {% static "abc.jpg" %}
?
First you need to keep this files in static folder Keep these files out of templates like
project_main_folder/static/img/abc.jpg
The recommended way is to use static tag provided by django.
{% static "abc.jpg" %}
Without static tag you can do this like
<img src="host:port/static/img/abc.jpg" />
or
<img src="/static/img/abc.jpg" />
This is not recommend.