Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added simple backend using Django's own FileWrapper class

  • Loading branch information...
commit 5981c0e031e297f2226b89544a00269ae0a26887 1 parent 761d7b6
@rosarior rosarior authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 sendfile/backends/simple.py
View
9 sendfile/backends/simple.py
@@ -0,0 +1,9 @@
+import os
+
+from django.core.servers.basehttp import FileWrapper
+from django.http import HttpResponse
+
+def sendfile(request, filename):
+ wrapper = FileWrapper(file(filename))
+ response = HttpResponse(wrapper)
+ return response
Please sign in to comment.
Something went wrong with that request. Please try again.