Added 3rd party sendfile app
This commit is contained in:
15
3rd_party_apps/sendfile/backends/development.py
Normal file
15
3rd_party_apps/sendfile/backends/development.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.views.static import serve
|
||||
|
||||
import os.path
|
||||
|
||||
def sendfile(request, filename):
|
||||
'''
|
||||
Send file using django dev static file server.
|
||||
|
||||
DO NOT USE IN PRODUCTION
|
||||
this is only to be used when developing and is provided
|
||||
for convenience only
|
||||
'''
|
||||
dirname = os.path.dirname(filename)
|
||||
basename = os.path.basename(filename)
|
||||
return serve(request, basename, dirname)
|
||||
Reference in New Issue
Block a user