Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadView return a DownloadResponse which is processed by middlewares/decorators #3

Closed
benoitbryon opened this issue Nov 16, 2012 · 1 comment

Comments

@benoitbryon
Copy link
Collaborator

As Django's generic views return TemplateResponse, DownloadView (or DownloadMixin) could return some DownloadResponse:

  • DownloadResponse stores minimal information about the file to download
  • Middlewares are given the opportunity to handle the response. Could be useful to implement Support Nginx X-HTTP-ACCEL header #1 (nginx) and Support Lighttpd's X-SENDFILE header #2 (lighttpd).
  • A fallback middleware serves the file with Python/Django, i.e. most of current DownloadMixin.render_to_response() logic would be moved to a middleware.
@benoitbryon
Copy link
Collaborator Author

#1 was implemented with decorators and middlewares. Seems ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant