Git Product home page Git Product logo

djangodav's Introduction

DjangoDav

Production ready WebDav extension for Django. This repository aims to be a consolidated fork of the various variants floating around in github.

Motivation

Django is a very popular tool which provides data representation and management. One of the key goals is to provide machine access to it. Most popular production ready tools provide json based api access. Which have their own advantages and disadvantages.

WebDav today is a standard for cooperative document management. Its clients are built in the modern operation systems and supported by the world popular services. But it very important to remember that it's not only about file storage, WebDab provides a set of methods to deal with tree structured objects of any kind.

Providing WebDav access to Django resources opens new horizons for building Web2.0 apps, with inplace edition and providing native operation system access to the stored objects.

Difference with SmartFile django-webdav

Base resource functionality was separated into BaseResource class from the storage functionality which developers free to choose from provided or implement themselves.

Improved class dependencies. Resource class don’t know anything about url or server, its goal is only to store content and provide proper access.

Removed properties helper class. View is now responsible for xml generation, and resource provides actual property list.

Server is now inherited from Django Class Based View, and renamed to DavView.

Key methods covered with tests.

Removed redundant request handler.

Added FSResource and DBResource to provide file system and data base access.

Xml library usage is replaced with lxml to achieve proper xml generation code readability.

How to create simple filesystem webdav resource

1. Create resource.py

from django.conf import settings
from djangodav.base.resources import MetaEtagMixIn
from djangodav.fs.resources import DummyFSDAVResource

class MyDavResource(MetaEtagMixIn, DummyFSDAVResource):
    root = '/path/to/folder'

2. Register WebDav view in urls.py

from djangodav.acls import FullAcl
from djangodav.locks import DummyLock
from djangodav.views import DavView

from django.conf.urls import patterns

from .resource import MyDavResource

urlpatterns = patterns('',
    (r'^fsdav(?P<path>.*)$', DavView.as_view(resource_class=MyDavResource, lock_class=DummyLock,
     acl_class=FullAcl)),
)

djangodav's People

Contributors

atin65536 avatar chrisv2 avatar eduard90 avatar meteozond avatar pellaeon avatar petrklus avatar ppdraga2 avatar sirmmo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.