Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

qiniu file uploader for flask!

Project description

Install

pip install qiniufs

Usage

# init
bucket_name = "your-qiniu-bucket-name"
prefix_url = "your-qiniu-domain"
fs = QiniuFS(bucket_name, access_key, secret_key, prefix_url)

# upload
mime = data.mimetype
r, d = fs.upload_data(data, mime=mime)
if r and d:
    key = d.get('key')
    url = fs.get_url(d.get('key'))

# delete
r = fs.delete_file(key)
if r:
    print "success"

Supported by

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