I need static server files in my Django project.
I would like to place them in the / static directory and be able to refer to them in my templates.
I read "Managing Static Files" in the documentation, and I'm confused. I followed the instructions, but could not get it to work.
1) I put my static files in / static in every application in my project.
2) django.contrib.staticfiles is included in my INSTALLED_APPS.
I set the following options in the settings:
STATIC_ROOT = '/static/' STATIC_URL = '/static/'
In my template, I have the following line:
<script type="text/javascript" src={{ STATIC_URL }}/a_ajax.js></script>
however, when I lift the page and look at the source, the line:
<script type="text/javascript" src=/a_ajax.js></script>
Nothing seems to have been passed to the template.
What am I doing wrong?
afshin
source share