I have javascript in the form <script src="/static/file.js" /> in a Django template. I would like this referenced file.js to get the {{ STATIC_URL }} and other template variables.
What would be the best way to give access to file.js to the template variables?
Render the desired variables in your main layout file, before you include file.js: