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.1a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea3c262dfeef8c735b9a730055166afb40dbde71d542028712e2200a1af86450 |
|
MD5 | 046d1be2ceb6c0f53cd16f856a3391f2 |
|
BLAKE2b-256 | 0be3471b6786076f9c82b53f6936682285b134665406b3de2d4f52ed0b0d9f79 |