Django storage with Qingstor
Project description
Django Qingstor Storage
A Django storage backend with Qingstor.
Requirements
- Python3
- Django >= 2.0
- qingstor-sdk >= 2.2.6
Installation
Using venv is highly recommended.
Install by PyPI:
pip install django-qingstor-storage
Install by source code, just clone the code, and run following commands to install:
cd django_qingstor_storage
python setup.py install
Settings
Edit your settings.py and set default(or other name) storage backend:
# set storage backend
DEFAULT_FILE_STORAGE = 'django_qingstor_storage.backends.QinstorStorage'
And add Qingstor config in the settings.py:
# Qingstor setting starts here
QINGSTOR_ACCESS_KEY_ID = 'YOUR_ACCESS_KEY_ID'
QINGSTOR_SECRET_ACCESS_KEY = 'YOUR_SECRET_ACCESS_KEY'
QINGSTOR_ZONE = 'YOUR_QINGSTOR_ZONE'
QINGSTOR_BUCKET = 'YOUR_QINGSTOR_BUCKET'
Also, you can set the Qingstor config by setting system environment variables with the following commands:
export QINGSTOR_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
export QINGSTOR_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
export QINGSTOR_ZONE=YOUR_QINGSTOR_ZONE
export QINGSTOR_BUCKET=YOUR_QINGSTOR_BUCKET
Demo site
We also provide a demo site with Django admin. Just clone the code, edit settings.py in demo_site directory. And use the following commands to make it running:
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Open your browser to visit http://localhost:8000 .
See Also
- Qinstor Python SDK(on github): https://github.com/yunify/qingstor-sdk-python
- Qinstor Python SDK docs: https://docs.qingcloud.com/qingstor/sdk/python/qingstor_sdk.html
- Qinstor Restful API: https://docs.qingcloud.com/qingstor/api/
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
Built Distribution
Close
Hashes for django_qingstor_storage-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa04d79f91a9e66ebf0d2dcc828a29d8bc662b1154615d6577374dcd20503d0 |
|
MD5 | 8b05f5af97f9f83b62e8bbe2b1b6830a |
|
BLAKE2b-256 | 67de78f06d90cdb12c70e4f902aca56036d1123e331cf6def53dd4c70e8c6db1 |
Close
Hashes for django_qingstor_storage-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98af534ac188415bf8f59eb504352264b727b63aade6123e231a545879920c7b |
|
MD5 | 07300c9de5486b3014cf8cba814f217f |
|
BLAKE2b-256 | f4f1b5ab89c5dec2a4ce17dae871d7c3fff9731c0460bc040072f70da970111f |