django backblaze b2 storage using b2sdk
Project description
django backblaze b2 storage using b2sdk
Documentation
The full documentation is at https://django-b2.readthedocs.io.
Quickstart
Install django-b2:
pip install django-b2
Add into your settings:
MEDIA_URL = '/media/'
DEFAULT_FILE_STORAGE = 'django_b2.storage.B2Storage'
B2_APP_KEY_ID=000xxxxxxxxxxxx000000000n
B2_APP_KEY=keyvalue
B2_BUCKET_NAME=bucketname
Using outside of Django:
from django_b2.backblaze_b2 import BackBlazeB2
b2 = BackBlazeB2()
b2.authorize("production", application_key_id, application_key)
b2.set_bucket(bucket_name)
with open(filename, 'rb') as f:
b2.upload_file(filename, f)
content = b2.download_file(filename)
with open(filename2, 'wb') as f:
f.write(content)
Features
Django media storage (with storage.py) or general python access to BackBlaze B2 (without use of storage.py).
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements_test.txt (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.4 (2020-01-02)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-b2-0.1.4.tar.gz
(8.8 kB
view hashes)
Built Distribution
Close
Hashes for django_b2-0.1.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3dbe11cdbc0f95ee98f900a8deac871aa6b4d333746acac53f7710efcf80866 |
|
MD5 | d9f64061a413eea36de505abc84e1b98 |
|
BLAKE2b-256 | f30307357725bf01a064e33602ef7c510ee4dca3c1a1cd034e79b3b6d90e1fea |