I'm using Django 1.3 and the static files in app is confusing. What I was doing: 1) Set the
STATIC_ROOT = as path to directory 'static' in my project STATIC_URL = '/static/' 2) Serve in my urls.py
if settings.DEBUG: urlpatterns += patterns( '', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), ) 3) Place css and js files into the folder 'static' in my application directory. So I got such directories tree:
my_project/ main_app/ static/ css/ style.css js/ secondary_app/ static/ foldername/ file.css 4) I added both of this applications to INSTALLED_APPS in settings.py file. And now in my template when I write follow line:
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" type="text/css" /> Django successfuly finds my css file in directory
my_project/main_app/static/css/ and plugs in style.css But when I write
<link rel="stylesheet" href="{{ STATIC_URL }}foldername/file.css" type="text/css" /> Django doesn't plug in this file.
So my question: What I'm doing wrong? Why I cant plug in my css file from secondary_app directory? What I have to tell you more about this situation?
STATIC_ROOTpoint to again?