The more I read about django statics , the less I know…
For now I understand there are three places for static files:
- place of collectstatics (STATIC_ROOT with STATIC_URL in django and location '/static/ in nginx
- project folder of statics
- app folder of statics (one for each app)
/home/project/
app1/
static/
admin.css (1)
app2/
static/
admin.css (2)
app3/
static/
noadmin.css
static/
admin.css (3)
staticfiles/
I think that adding admin.css to staticfiles is bad idea - because I think we should expect that staticfiles shouldn’t be synchronised (backed up) - admin can always empty this folder and python manage.py collectstatic should fix everytime
But there’s a problem with nginx… Nginx is serving /static/ to staticfiles/ as expected, but what about all other static folders???
How should I use other statics in my templates?
I want to use admin.css in base template, so If it is used by app1 or app2 it uses admin.css from corresponding folder (1) or (2) and when used by app3 it should use admin.css from project’s admin folder (3)