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/
- Django Custom Storage HOW-TO: https://docs.djangoproject.com/en/2.1/howto/custom-file-storage/
Metadata
Release files for django-qingstor-storage 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django_qingstor_storage-0.1.2.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_qingstor_storage-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / django_qingstor_storage-0.1.2.tar.gz
| Download URL | django_qingstor_storage-0.1.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a39992d156995d17d21f2873d1ba883c0483250f534313987b709b6a4c28a1e
|
|
BLAKE2b-256 checksum How to use checksums |
eaa219458d391fc2d90e458d29e089e19ddde3c795d73502293d6c65fb5d6250
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
|
Release files / django_qingstor_storage-0.1.2-py3-none-any.whl
| Download URL | django_qingstor_storage-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d3b1f16961421f3fc39a954965383cb553cb1db83a53288f33f07931f41dfc7
|
|
BLAKE2b-256 checksum How to use checksums |
2ee86b936257d3f9d151df2bf9aaa85f8a903996ee1e8c76df54b0c95b0aa451
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
|
Security for django-qingstor-storage 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.