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
Built Distribution
Close
Hashes for django-fileprovider-0.1a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9f92cb2d4a343c6fcc869fcd64790ba0fe13eaad06e81d2e234634037930408 |
|
MD5 | 3be0125f72ec6afed4586455e4acc770 |
|
BLAKE2b-256 | 2dea2f6ed0be2e383e83af3f1d3d1a646cd557c61875bd69fd35cb4d4c412864 |
Close
Hashes for django_fileprovider-0.1a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 399868c7196acb649d6512e58ba4e47d257fbe09e894ea635db5b830cea311ed |
|
MD5 | 7e3dfd8385e74b42b6dda57d6c8bd0ab |
|
BLAKE2b-256 | ab820c89b6ebede4e116e3378502c9de0ae80955148d22bb9501380de8060637 |