django middleware for serving media files
Project description
# INSTALLATION
use pip to install package:
`pip install -e git+https://github.com/instapk/django-fileprovider.git@0.1a5#egg=django-fileprovider`
* add `fileprovider` to django `INSTALLED_APPS` section.
* add `fileprovider.middleware.FileProviderMiddleware` to `MIDDLEWARE_CLASSES` section
* set django `settings` file with `FILEPROVIDER_NAME` any of available providers {'python', 'nginx', 'apache'}
# USAGE
on django views where file response is required, fill response header `X-File` with absolute file path
for example,
```python
def hello(request):
response = HttpResponse()
response['X-File'] = '/absolute/path/to/file'
return response
```
use pip to install package:
`pip install -e git+https://github.com/instapk/django-fileprovider.git@0.1a5#egg=django-fileprovider`
* add `fileprovider` to django `INSTALLED_APPS` section.
* add `fileprovider.middleware.FileProviderMiddleware` to `MIDDLEWARE_CLASSES` section
* set django `settings` file with `FILEPROVIDER_NAME` any of available providers {'python', 'nginx', 'apache'}
# USAGE
on django views where file response is required, fill response header `X-File` with absolute file path
for example,
```python
def hello(request):
response = HttpResponse()
response['X-File'] = '/absolute/path/to/file'
return response
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-fileprovider-0.1a5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5e5623c95e6e09242b255b9348052775e2a82a89118d270baf82744fd89bd10 |
|
MD5 | 5609ce9fa24cfebd73f7d7cd0dbe4250 |
|
BLAKE2b-256 | 44b0c7a6c588a04e8871a97dbccc30cac4cc61c79491a811545851f81869151d |