Skip to main content

This application allows you easily save media and static files into webdav storage

Project description

Travis CI build status Code coverage percentage Latest version on PyPI Wheel Status Supported Python versions

This application allows you easily save media and static files into webdav storage.

Dependencies

Installation

  1. Install the package

pip install django-webdav-storage
  1. 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/'
  1. Set the webdav storage class as default:

DEFAULT_FILE_STORAGE = 'django_webdav_storage.storage.WebDavStorage'

WebDAV nginx 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

django-webdav-storage-0.2.zip (9.8 kB view hashes)

Uploaded Source

django-webdav-storage-0.2.tar.gz (4.7 kB view hashes)

Uploaded Source

django-webdav-storage-0.2.tar.bz2 (5.1 kB view hashes)

Uploaded Source

Built Distribution

django_webdav_storage-0.2-py2.py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page