On Topic/OT- templates, static
Apologies in advance for the somewhat off topic but this is a smart group. Working a project with twitter bootstrap and can render the templates but no matter what I try, css, img, js components aren't accessed. Using django-annoying and Kenneth's 'root' code in base.py to relative reference the paths. Both templates dir and static dir have the code root("templates") and root("static") respectively. TIA, V.
Answers
Kenneth, thanks very much for the clarification on the various URLs and DIRs. It makes much more sense now. Does it really matter if the site wide static files (css, img, js) are down at the app level if the URLS are properly coded? In my case this is a simple informational site and somehow I've placed my files a directory down. I.E. projectname/appname/static/css...etc. Asking for general info purposes in case others find themselves in a similar situation. i realize this is incorrect for a multi-app project.
Have to review my code and I'll be back with further observations.
First thing to check is that both TEMPLATE_DIRS and STATICFILES_DIRS are proper tuples in your settings. They should look like:
STATICFILES_DIRS = (
root("assets"),
)
Note the comma after the call to root().
Secondly, check that their paths are what you expect. In your Django shell (python manage.py shell), import settings (from django.conf import settings) and check that, say STATIC_ROOT is where you expect it to be (getattr(settings, "STATIC_ROOT")).
You should not need django-annoying, btw.
I'm asking the question because I still can't wrap my head around the media, static dirs & urls code layout.