Python wsgidav

pip3 install cheroot wsgidav
pip3 install python-pam
# 运行
wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=pam-login #linux ,用户名就是linux系统的用户名和密码
wsgidav --host=0.0.0.0 --port=80 --root=d:/tmp --auth=anonymous #windows 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Python wsgidav is a WebDAV server implementation in Python. It allows you to serve your files and folders over the WebDAV protocol, making it easy to access and manage your files remotely. With wsgidav, you can create a WebDAV server that supports various operations like browsing directories, uploading and downloading files, creating and deleting folders, and more. To use wsgidav, you need to install it first. You can do this by running the following command: ``` pip install wsgidav ``` Once installed, you can create a simple WebDAV server by writing a Python script. Here's an example: ```python from wsgidav.wsgidav_app import WsgiDAVApp # Create a configuration dictionary config = { "host": "localhost", "port": 8080, "provider_mapping": { "/": "/path/to/serve" }, "verbose": 1 } # Create the WsgiDAV application app = WsgiDAVApp(config) # Run the server if __name__ == "__main__": from wsgiref.simple_server import make_server httpd = make_server(config["host"], config["port"], app) print(f"Starting wsgidav on {config['host']}:{config['port']}") httpd.serve_forever() ``` In this example, we create a server that serves the files located in "/path/to/serve" directory on localhost:8080. You can modify the `config` dictionary to suit your needs. Once you run the script, you should be able to access the files and folders served by the WebDAV server using a WebDAV client or a web browser that supports WebDAV. Please note that wsgidav is just one of the many Python libraries available for implementing a WebDAV server. There are other options as well, depending on your specific requirements.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值