This application allows you easily save media and static files into webdav storage
Project description
This application allows you easily save media and static files into webdav storage.
Dependencies
requests library
Installation
Install the package
pip install django-webdav-storage
Pick the webdav server url in WEBDAV_URL and WEBDAV_PUBLIC_URL:
WEBDAV_URL = 'http://webdav.example.com/',
WEBDAV_PUBLIC_URL = 'http://webdav.example.com/'
If you want use HTTP Basic authorization to webdav access, you can specify your credentials like that:
WEBDAV_URL = 'http://johndoe:secret@webdav.example.com/'
Set the webdav storage class as default:
DEFAULT_FILE_STORAGE = 'django_webdav_storage.storage.WebDavStorage'
If your webdav backend can’t recursively create path (e.g. nginx can do this, while apache can’t), set the WEBDAV_RECURSIVE_MKCOL variable to True:
WEBDAV_RECURSIVE_MKCOL = True
The nginx webdav configuration example
server {
listen 80;
charset utf-8;
server_tokens off;
server_name webdav.example.com;
access_log /var/log/nginx/webdav_access.log;
error_log /var/log/nginx/webdav_error.log;
root /usr/share/nginx/webdav;
location / {
client_max_body_size 10m;
client_body_temp_path /tmp;
create_full_put_path on;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_access user:rw group:r all:r;
satisfy any;
limit_except GET {
allow 127.0.0.1/32;
deny all;
auth_basic 'My WebDAV area';
auth_basic_user_file /usr/share/nginx/.htpasswd;
}
}
}
Caveats
In python 3.x ContentFile with text mode content (not binary one) will causes TypeError due requests restrictions
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for django-webdav-storage-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d63e859b32ecfe2fec0777a39eb002c6334fa39965054a6d86bb34717054ac54 |
|
MD5 | 1744fd6296224d2622f77c8aa161a9f3 |
|
BLAKE2b-256 | cf0a8707e021be99330f578fc4497bc9eab6ed513f9652e58fc671ca4d4f8889 |
Hashes for django-webdav-storage-0.4.tar.bz2
Algorithm | Hash digest | |
---|---|---|
SHA256 | 703ebb0f94727605dc9a5f802a988f6731169fc87a54b6502357e9f4d645ce40 |
|
MD5 | 22a5e3d3ccde7ebf39e9d89777e9d45e |
|
BLAKE2b-256 | 3736694abf35fc3624813b08f73ba1b5a1d00e80188ee1aa3a371c0c89cff6b6 |
Hashes for django_webdav_storage-0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eefa6a857e28ccef52195a8699b8fbc907eb8e30580fbdbd3ef48d3cedaf05d2 |
|
MD5 | 435c6f317b82419c016ef3304aa9558e |
|
BLAKE2b-256 | ad0e19bcfe67868c74e11f1c3ad2da899935f4c3b9f6e8357d9baa05fc2a7621 |