[Answered ]-Using upload_to with STATICFILES_DIRS


Media and Static files might seem similar on first glance, but when you dig deeper you will find that Django draws a fine line between both. While Media usually refers to files uploaded by users, static files are created and bundled together with django apps.

The idea behind static files is, that upon release you can call

./manage.py collectstatic

and have all your static files from your apps (even 3rd party ones that live in egg files) collected into a given directory your HTTP server can serve directly (without any django/wsgi in the middle) for best performance.

The same holds true for Media files, but they are uploaded by users and not created by you or other app developers.

Hope that eases your confusion 🙂

I recommend you take a look at the excellent documentation at the Django homepage:

Leave a comment