diff --git a/README.md b/README.md index d319dd9..c371262 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ -# flask-qiniu -Qiniu file system for Flask +QINIUFS +======= + +Qiniu file uploader for Flask + + +## Install +``` +$ pip install qiniufs +``` + +## Usage +```python +bucket = "your-qiniu-bucket-name" +prefix_urls = "your-qiniu-url" +fs = QiniuFS(bucket, access_key, secret_key, prefix_urls) + +def upload_picture(picture): + mime = picture.mimetype + data = picture.read() + if data: + r, d = fs.upload(data, mime) + if r and d: + key = d.get('key') + url = fs.get_url(d.get('key')) + return key, url +``` diff --git a/setup.py b/setup.py index 7574af7..99d2624 100644 --- a/setup.py +++ b/setup.py @@ -4,12 +4,12 @@ .. code:: bash - pip install flask-qiniu + pip install qiniufs Links ````` -* `website `_ +* `website `_ """