jazzband / django-downloadview

Serve files with Django.
https://django-downloadview.readthedocs.io
Other
364 stars 58 forks source link

Add development backend #130

Open pkaczynski opened 7 years ago

pkaczynski commented 7 years ago

It would be nice to have feature, such as in django-sendfile, to have some kind of development backend which does not specify a backend and basically does nothing with the response.

Maybe it is possible to configure SmartDownloadMiddleware like that? SMartDownloadMiddleware checks if BACKEND and RULES are difined. My goal is to have some kind of basic settings which is extended by local settings. However, having MIDDLEWARE_CLASSES in base settings makes it impossible to extend it in local ones.

benoitbryon commented 7 years ago

You are right, SmartDownloadMiddleware raises error if settings.DOWNLOADVIEW_BACKEND is not set. And yes, a "development" backend would make it possible to avoid modifying MIDDLEWARE_CLASSES and just adapt DOWNLOADVIEW_BACKEND. Looks like a good idea :)

benoitbryon commented 7 years ago

Tagging as "medium priority" because it is not blocker. That said, it looks like a nice idea and a quite easy change.