Comment

Reinout van Rees

I'm using django-staticfiles at the moment. The big advantage is that you can have a yourapp/media/yourapp/ directory per application, just like with templates. django-staticfiles will find them all. And there's an option to collect them all into one directory, ready for serving with apache/nginx.

It does not do minimization. And it does not add a timestamp to a filename, so aggressive caching is out. Those two are real nice features of django-static.

So I'm now breaking my head trying to come up with a a tactic for combining the best of both :-)

Replies

Peter Bengtsson

That idea of having static media per app is a great one because sometimes I find myself creating something invoicing.js or user_admin.css which are clearly not "global".

Then again, templates are ideally placed in the root /templates/myapp/ not inside /myapp/templates/. I guess we could and should do the same with static stuff.

Reinout van Rees

If an a app is going to be reused in quite a number of sites (like we're planning at our company), placing it inside de app is the best way. Otherwise you're duplicating the same template in every site's root/templates/* directory...