I have a Django app, with a folder named static
. When the app is deployed, python manage.py collecstatic
is automatically ran and this folder is copied into public/static
and everything works perfectly.
However, I want to run a gulp task before, that minifies my files and copy them into a folder named dist
.
The question is : is there a way to specify to collecstatic
command, in which folder are the static files ?
Asked
Active
Viewed 1,173 times
1

rocketer
- 1,051
- 3
- 13
- 40
1 Answers
1
You should just configure the STATICFILES_DIRS
: https://docs.djangoproject.com/en/1.9/ref/settings/#staticfiles-dirs
For further reading: https://lincolnloop.com/blog/integrating-front-end-tools-your-django-project/
Btw I would consider separating the front-end code and the backend code and serve the frontend from a CDN

fodma1
- 3,485
- 1
- 29
- 49
-
It works. However, the folder `dist` is copied. However, the folder named `static` also is. Is there a way to remove this default behavior ? – rocketer Dec 16 '15 at 16:37
-
Isn't it possible that the files from static were copied into public/static before you set up `STATICFILE_DIRS`? – fodma1 Dec 17 '15 at 12:35