Fixed #24072 -- Added FileResponse for streaming binary files.

This commit is contained in:
Collin Anderson 2015-01-03 12:06:24 -05:00 committed by Tim Graham
parent 05f702b94c
commit 3d2cae0896
9 changed files with 88 additions and 9 deletions

View file

@ -1,5 +1,5 @@
from django.conf.urls import url
from django.http import HttpResponse
from django.http import HttpResponse, FileResponse
def helloworld(request):
@ -7,4 +7,5 @@ def helloworld(request):
urlpatterns = [
url("^$", helloworld),
url(r'^file/$', lambda x: FileResponse(open(__file__, 'rb'))),
]