FastDFS--Python交互

FastDFS–Python交互

from fdfs_client.client import Fdfs_client
client = Fdfs_client('/etc/fdfs/client.conf')  # 指定配置文件
ret = client.upload_by_filename('./Spring.png') # 上传文件
ret
{'Group name': 'group1',
 'Remote file_id': 'group1/M00/00/00/wKgyW11actCAXe7qAABkZwGFfSA060.png',
 'Status': 'Upload successed.',
 'Local file name': './Spring.png',
 'Uploaded size': '25.00KB',
 'Storage IP': '192.168.50.91'}
pip install fdfs_client-py # 1.2.6
pip install mutagen # 1.42.0
pip install requests

你可能感兴趣的:(python_Django)