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.1a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0afa37ed41ec1d06bcba30cd894941d2e2dde59560a1c2578df7ea8b3972535 |
|
MD5 | b4ca59df7ef4c6be56b1cf5724f3e1db |
|
BLAKE2b-256 | 331f3568137cb5a238baec2cbffd65880fb4eda0a8ae75f431a363520fa6d422 |