Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Django staticfiles to not collect user uploaded media directory files?

I have a very simple question which I was not able to find an answer. Using Django staticfiles app, I call the statics collect routine by typing this command line : python manage.py collectstatic.

My problem is that I've several applications serving statics + a media directory containing user-uploaded files. Django copies all the files to the static directory, including media files!

I just would like Django to not copy user-uploaded files to the static directory when I call python manage.py collectstatic. Does anyone have an idea? Tried --ignore option but without success...

Thank you in advance.

like image 726
user650108 Avatar asked Feb 29 '12 11:02

user650108


1 Answers

That was a problem of django.contrib.staticfiles.finders.DefaultStorageFinder, try removing that from STATICFILES_FINDERS.

like image 83
Pavel Shvedov Avatar answered Nov 05 '22 04:11

Pavel Shvedov