Hi Jannis, Thanks for your reply, On Sun, Jul 14, 2013 at 10:16 AM, Jannis Leidel <lei...@gmail.com> wrote: > > I'm pretty sure we don't want to increase the code that deals with > serving files. We've repeatedly improved the documentation about > helping users to configure their web server to serve the files instead > of adding an official file serving WSGI middleware like you propose > here. Especially since we already provide a view in > django.views.static to serve files I think we need to clarify what the > purpose of the FSFilesHandler would be. If there is little good reason > (e.g. only supporting LiveServerTestCase) then we **shouldn't** make > the FSFilesHandler a new core component but just a implementation > detail.
It would support it and the staticfiles handler but I agree with you on that we should not be shipping something like FSFilesHandler or at least should move it near where it's used and/or marking/documenting it as internal. > >> Another change introduced is duplicating (simplifying it slightly) >> django.contrib.staticfiles.views.serve() view functionality. > > Where was that duplicated specifically? Couldn't find it in the pull request. Ah yes, sorry for not making the PR more granular commit-wise. This is the staticfiles serve() view: https://github.com/django/django/blob/master/django/contrib/staticfiles/views.py#L20 and this is the new, albeit simplified, duplicate copy: https://github.com/django/django/pull/1354/files#L3R1072 > >> The last stumbling block we need to remove is use of staticfiles' >> finders infrastructure, for which I don't have any solution for now. > > Maybe the LiveServerTestCase should simply have a generic file serving > feature, basically just using the core static view to serve > STATIC_ROOT under STATIC_URL. > > Users that want to continue using staticfiles we could ask to call > collectstatic in a setUpClass method in their LiveServerTestCase > subclasses. Or just ask them to run it before running the tests. > > [...] I think decoupling the file serving slightly from how the files > got to the place they are served from, is a good first step. The > common denominator between the core ability to serve files and > staticfiles is the reliance on conventions like STATIC_ROOT and > STATIC_URL. If we can backscale LiveServerTestCase to only do the core > ability out of the box and document the way to do it the staticfiles > way, then I think we're on the right track. I will be working further on the PR keeping all this design advice in mind. Thanks again, > > Jannis > -- Ramiro Morales @ramiromorales -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. For more options, visit https://groups.google.com/groups/opt_out.