How to have separate folders for each app's static files in Django
When I run python manage.py collectstatic
, it puts all static files from different apps together in one location (STATIC_ROOT
). I would like to have a separate folder within STATIC_ROOT
for each app. For example static files from app1/static
should go to STATIC_ROOT/app1
and static files from app2/static
should go to STATIC_ROOT/app2
. One way to do this would be to create a开发者_如何学Cnother subfolder, i.e. app1/static/app1
- but I was wondering if there was a better way to do this.
I usually put them all in one directory like the following just like how I work with templates:
MyProject/staticfiles/app1
MyProject/staticfiles/app2
MyProject/staticfiles/app3
精彩评论