Hi Waldemar, On Oct 20, 1:40 pm, Waldemar Kornewald <wkornew...@gmail.com> wrote: [snip] > However, what staticfiles does has almost nothing to do with "bigger > project" asset management. Just look at the features grid on > djangopackages (disclaimer: I'm the author of django-mediagenerator > and I maintain that grid):http://djangopackages.com/grids/g/asset-managers/ > It's obvious that django-staticfiles has none of the critical features: > * It doesn't combine your CSS/JS files. > * It doesn't compress them. > * It doesn't support CSS compilers like Sass or Less. > * It doesn't support versioning of CSS, JS, and images. > * Because of the lack of versioning the staticfiles view doesn't (and > can't) support proper caching which means for every single visited > page the browser will make unnecessary "if-modified-since" roundtrips > to the very slow runserver. These unnecessary HTTP roundtrips make it > very painful to work even on medium sized projects (unless combined > with a local dev http server like Apache). > * Finally, staticfiles doesn't auto-regenerate the assets when they > are changed.
And the "lack" of all of these features is precisely why staticfiles is well suited to contrib, whereas something like mediagenerator is not (even though it may be very useful). Staticfiles has a very specific, well-defined purpose (collecting media files from apps), which fills a major hole in the Django "story" for reusable apps. It does not come with a pile of additional features outside that scope, adding much more code and more areas where people may reasonably disagree on the best implementation. Every feature you list here can easily be provided by a separate app on top of staticfiles. I currently use staticfiles in combination with django_compressor, which provides all these additional features (compression, combining, versioning, auto-regenerating when changed), and the combination works very well. I prefer having separable concerns in separate apps whenever possible, and the tasks performed by staticfiles and compressor are very much separable. > This makes development extremely painful and error-prone > because you have to "manage.py collectstatic" every time you make a > little change to your JS or CSS code (and that's really easy to > forget). In development you generally would not run "manage.py collectstatic" at all; you use the dynamic-serving view instead so changes are reflected instantly. Carl -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.