{"id":10358,"library":"wsgidav","title":"WSGI WebDAV Server","description":"WsgiDAV is a generic and extensible WebDAV server implementation based on WSGI. It allows access to file systems or other storage backends via HTTP, supporting features like locking, versioning, and properties. Currently at version 4.3.3, it receives frequent minor updates with a focus on stability and compatibility.","status":"active","version":"4.3.3","language":"en","source_language":"en","source_url":"https://github.com/mar10/wsgidav","tags":["webdav","wsgi","server","filesystem","http"],"install":[{"cmd":"pip install wsgidav","lang":"bash","label":"Install core library"},{"cmd":"pip install wsgidav[server]","lang":"bash","label":"Install with default server (Cheroot)"},{"cmd":"pip install wsgidav[yaml]","lang":"bash","label":"Install with YAML config support"}],"dependencies":[{"reason":"Default and recommended WSGI server for WsgiDAV.","package":"cheroot","optional":true},{"reason":"Required for loading configuration from YAML files.","package":"pyyaml","optional":true}],"imports":[{"note":"The main WSGI application class was moved to a submodule in v4.0.0.","wrong":"from wsgidav import WsgiDAVApp","symbol":"WsgiDAVApp","correct":"from wsgidav.wsgidav_app import WsgiDAVApp"},{"symbol":"FileSystemProvider","correct":"from wsgidav.fs_dav_provider import FileSystemProvider"},{"note":"The server running utility was moved to its own submodule in v4.0.0.","wrong":"from wsgidav.wsgidav_app import run_server","symbol":"run_server","correct":"from wsgidav.server import run_server"}],"quickstart":{"code":"import os\nfrom wsgidav.wsgidav_app import WsgiDAVApp\nfrom wsgidav.fs_dav_provider import FileSystemProvider\nfrom wsgidav.server import run_server\n\n# Create a temporary directory for the WebDAV root\ndav_root = os.path.join(os.getcwd(), 'my_webdav_root')\nos.makedirs(dav_root, exist_ok=True)\n\n# Create a simple file inside the root\nwith open(os.path.join(dav_root, 'hello.txt'), 'w') as f:\n    f.write('Hello, WebDAV!')\n\nconfig = {\n    \"host\": \"127.0.0.1\",\n    \"port\": 8080,\n    \"provider_mapping\": {\n        \"/\": FileSystemProvider(dav_root)\n    },\n    \"http_authenticator\": {\n        \"domain_controller\": None, # No authentication\n        \"accept_anonymous\": True\n    },\n    \"verbose\": 1,\n    \"dir_browser\": {\n        \"enable\": True,\n        \"remotefs\": {\n            \"enable\": True,\n            \"mount_url\": \"/\",\n        }\n    }\n}\n\nprint(f\"Starting WsgiDAV server on http://{config['host']}:{config['port']}\")\nprint(f\"Serving files from: {dav_root}\")\nprint(\"Open http://127.0.0.1:8080/ in your browser to test.\")\n\n# Run the server. This is a blocking call.\n# For production, integrate WsgiDAVApp with a full WSGI server like Gunicorn or uWSGI.\nrun_server(config)\n","lang":"python","description":"This quickstart demonstrates how to set up a basic, anonymous WebDAV server serving a local directory using WsgiDAV programmatically. It creates a temporary directory and a sample file, then starts the server on `http://127.0.0.1:8080`. For production deployments, `WsgiDAVApp` should be integrated with a robust WSGI server like Gunicorn or uWSGI, and authentication should be configured."},"warnings":[{"fix":"Upgrade your Python environment to 3.8+. Review the v4.0.0 changelog for necessary code migrations, especially around configuration, imports, and authentication. Many internal modules were moved or renamed.","message":"WsgiDAV v4.0.0 introduced significant breaking changes, dropping Python 2 support and requiring Python 3.6+ (now 3.8+).","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"If upgrading from pre-v4, re-write your `config` dictionary based on the v4 documentation and examples. Pay close attention to `provider_mapping`, `http_authenticator`, and `dir_browser` sections.","message":"The configuration format changed significantly in v4.0.0, with many options renamed or restructured (e.g., `provider_mapping` to `roots` in some contexts, `verbose` to `debug_info`).","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"For production deployments, pass the `WsgiDAVApp` instance to a robust WSGI server like Gunicorn, uWSGI, or mod_wsgi. E.g., `gunicorn 'wsgidav.wsgidav_app:WsgiDAVApp(config)'` (adjusting config loading).","message":"By default, `wsgidav` expects a WSGI server to run it. While `wsgidav.server.run_server` provides a simple built-in server (Cheroot), it's not recommended for production.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update any direct imports or references to `wsgidav.dir_browser` to `wsgidav.frontend.dir_browser`.","message":"The `wsgidav.dir_browser` module was deprecated and moved to `wsgidav.frontend.dir_browser` in v4.0.0.","severity":"deprecated","affected_versions":"<4.0.0"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Update your import statement from `from wsgidav import dir_browser` or similar to `from wsgidav.frontend import dir_browser`.","cause":"This import path was deprecated and moved in WsgiDAV v4.0.0.","error":"ModuleNotFoundError: No module named 'wsgidav.dir_browser'"},{"fix":"The `verbose` option was renamed. Replace `verbose` with `debug_info` in your configuration dictionary (e.g., `\"debug_info\": True`). Refer to the v4 documentation for current configuration options.","cause":"Configuration option names changed in v4.0.0.","error":"TypeError: WsgiDAVApp() got an unexpected keyword argument 'verbose'"},{"fix":"Ensure the directory specified for `FileSystemProvider` (e.g., in `provider_mapping`) exists and the user running WsgiDAV has read/write permissions to it. Create the directory if it's missing.","cause":"This typically occurs when `FileSystemProvider` is configured with a path that doesn't exist or isn't accessible to the WsgiDAV process.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'some_path'"}]}