mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #24072 -- Added FileResponse for streaming binary files.
This commit is contained in:
parent
05f702b94c
commit
3d2cae0896
9 changed files with 88 additions and 9 deletions
|
@ -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'))),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue