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

Delete generated files as soon as server (nginx) streaming ends #14

Open
benoitbryon opened this issue Dec 7, 2012 · 1 comment
Open

Comments

@benoitbryon
Copy link
Collaborator

Scenario:

  • generate a file with Django (as an example, some ZIP file)
  • save it to disk
  • let server stream it (X-Accel for nginx)
  • remove the file when it's done

Is it possible to do it with django-downloadview?

Is it recommended to do it with django-downloadview? i.e. should Django stream file contents directly and write nothing to disk? Maybe there are 2 cases: when the file can be generated with some iterator (as a CSV file) VS when the file is generated in a single operation (as a zip archive).

Another use case: file is stored in a storage that nginx can't access. Django could copy file to a temporary location and let nginx serve it. Or maybe the best practice is: "allow nginx to access file storage directly".

=> at least add documentation
=> if a smart solution can be implemented, add it to django-downloadview

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

No branches or pull requests

1 participant