django middleware for serving media files
Project description
# INSTALLATION
use pip to install package:
`pip install -e git+https://bitbucket.org/renlinx007/django-fileprovider.git@0.1a#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://bitbucket.org/renlinx007/django-fileprovider.git@0.1a#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.1a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 789f1d1a4de7e42e51f398674c1b64fedd1c466081bd9b66dd2026e49ea0c1f8 |
|
MD5 | d98c15ca6ce589c92fb6020dd6b1217e |
|
BLAKE2b-256 | 80a44b7ebc74d3de4f2529d68676d39d31206deaca7087d051061c01f7221531 |