# Cloudflare R2

Cloudflare R2 implements an S3 Compatible API. To use it as a django-storages backend:

1. Create an R2 bucket using Cloudflare’s web panel or API

2. Follow Cloudflare’s docs to create authentication tokens, locking down permissions as required

3. Follow the instructions in the Amazon S3 docs with the following exceptions:

   - Set `bucket_name` to your previously created bucket

   - Set `endpoint_url` to `https://<ACCOUNT_ID>.r2.cloudflarestorage.com`

   - Set the values of `access_key` and `secret_key` to their respective Cloudflare keys

Note

If you need a jurisdiction-specific endpoint or other advanced features, consult the Cloudflare docs.