1👍
✅
Static files are static, which means they are not interpreted by Django, so cannot use tags in them.
However, you can refer to a static file from any other static file using relative paths assuming that the file is accessible.
There are a lot of topics on SO referring to how to include one javascript file from another one, for example: How do I include a JavaScript file in another JavaScript file?
0👍
Use a normal absolute/relative path to refer to files inside *.js
files.
Static files are only served, not rendered by Django, therefore you can’t use template tags inside of them.
- Django 1.9 pushing our code to go live today but have static directory issue
- I need different data on different http action in django rest.Can i do it without making too many serializers?
Source:stackexchange.com