Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for using django-storages with Scaleway Object storage #1259

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/backends/scaleway.rst
@@ -0,0 +1,23 @@
Scaleway
=============

Scaleway Object storage implements the S3 protocol. To use it follow the instructions in the :doc:`Amazon S3 docs <amazon-S3>` with the important caveats that you must:

- Set ``AWS_BUCKET_NAME`` to the Bucket you want write to (such as ``my-chosen-bucket``)
- Set ``AWS_S3_REGION_NAME`` to your Scaleway region (such as ``nl-ams`` or ``fr-par``)
- Set ``AWS_S3_ENDPOINT_URL`` to the value of ``https://{AWS_BUCKET_NAME}.s3.${AWS_S3_REGION_NAME}.scw.cloud``
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bucket name should not be included into the endpoint.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Laurent, much appreciated 👍

- Set ``AWS_ACCESS_KEY_ID`` to the value of your Access Key ID (i.e. ``SCW3XXXXXXXXXXXXXXXX``)
- Set ``AWS_SECRET_ACCESS_KEY`` to the value of your Secret Key (i.e. ``abcdef10-ab12-cd34-ef56-acbdef123456``)

With the settings above in place, with django storages set as DEFAULT_FILE_STORAGE, if you wrote a file like so:


from django.core.files.storage import default_storage
file = default_storage.open("my_chosen_file.txt", "w")
file.write("storage contents")
file.close()

If would be written to the following address:

https://my-chosen-bucket.s3.nl-ams.scw.cloud/my-chosen-bucket/my_chosen_file.txt
mrchrisadams marked this conversation as resolved.
Show resolved Hide resolved