On 11/07/2015 04:29 PM, René Fleschenberg wrote:
Hi Gary,
In your second example:
├── archive
│   ├── archive
│   │   ├── __init__.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── home
│   ├── static
|   |     |___home
│   │         ├── home.css
│   │         ├── images
you have what I would call a "global" static files directory. Files from
this directory will only be found if you configure that directory in your
settings:

STATICFILES_DIRS = (
     os.path.join(BASE_DIR, "static"),
)

This is because that directory is not part of any app that is listed in
INSTALLED_APPS.

BASE_DIR is the top-level "archive" directory, by the way (the first
"archive" in the tree).

I hope this helps.


Because this gets asked so often, I am trying to  to sump it up here:

https://fleschenberg.net/django-staticfiles/

I'd love to hear your feedback about this article, i.e. if it clarifies
things for you, or how to improve it.

Thanks for the tips. I read your 'In a nutshell" . Good work. Now, getting into setup philosophy, it occurs to me that it would be nice to have global static files for such things as a style.css file since the file should set the style of your whole web site. I suppose that one could put a copy of the file under each apps static folder but change control would be horrible. Could I set up both a global static folder and then have a static folder under each app? Being rather new to this rats nest (great framework all the same) I'm probably skating on rather thin ice here. Be kind.
As to your comment on the first tree, I think I created the problem 
while cutting and pasting. The actual project works - mostly.
A comment on "6 An alternative approach". This actually my case. When 
you say that the app listed first takes precedence.
Looking forward to your comments.

Gary R

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/563F6DA5.1050909%40verizon.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to