{"id":21161,"library":"django-s3-storage","title":"django-s3-storage","description":"A Django storage backend for Amazon S3. It provides a drop-in replacement for Django’s default file storage, with support for custom domains, ACLs, and more. Current version: 0.15.0. Release cadence is irregular, with minor and patch releases as needed.","status":"active","version":"0.15.0","language":"python","source_language":"en","source_url":"https://github.com/etianen/django-s3-storage","tags":["django","storage","s3","amazon-s3","django-storage"],"install":[{"cmd":"pip install django-s3-storage","lang":"bash","label":"Default installation"},{"cmd":"pip install django-s3-storage[boto3]","lang":"bash","label":"With boto3 backend"}],"dependencies":[{"reason":"Core dependency; requires Django >= 3.2","package":"django","optional":false},{"reason":"Required for S3 interaction","package":"boto3","optional":false}],"imports":[{"note":"S3Storage is in the storage submodule, not at the package root.","wrong":"from django_s3_storage import S3Storage","symbol":"S3Storage","correct":"from django_s3_storage.storage import S3Storage"},{"note":"Also in storage submodule, not top-level.","wrong":"from django_s3_storage import ManifestStaticS3Storage","symbol":"ManifestStaticS3Storage","correct":"from django_s3_storage.storage import ManifestStaticS3Storage"}],"quickstart":{"code":"import os\n\n# settings.py\nINSTALLED_APPS = [\n    'django_s3_storage',\n    ...\n]\n\nAWS_REGION = 'us-east-1'\nAWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', '')\nAWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', '')\nAWS_S3_BUCKET_NAME = 'my-bucket'\nAWS_S3_BUCKET_AUTH = False\n\nDEFAULT_FILE_STORAGE = 'django_s3_storage.storage.S3Storage'\nSTATICFILES_STORAGE = 'django_s3_storage.storage.ManifestStaticS3Storage'\n","lang":"python","description":"Minimal configuration for S3 file and static storage."},"warnings":[{"fix":"Set AWS_S3_BUCKET_AUTH = True in settings if you need signed URLs.","message":"In version 0.14.0, the default value for AWS_S3_BUCKET_AUTH changed from True to False. If you relied on the old default (signed URLs), you must explicitly set AWS_S3_BUCKET_AUTH = True.","severity":"breaking","affected_versions":">=0.14.0"},{"fix":"Use the STORAGES dict instead: STORAGES = {'default': {'BACKEND': 'django_s3_storage.storage.S3Storage'}, 'staticfiles': {'BACKEND': 'django_s3_storage.storage.ManifestStaticS3Storage'}}","message":"Django's DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings are deprecated in Django 4.2+ in favor of STORAGES.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure AWS_S3_BUCKET_AUTH matches your bucket's public/private access policy.","message":"Misconfiguration of AWS_S3_BUCKET_AUTH can cause public files to be inaccessible or private files to be exposed. The setting controls whether file URLs are signed. When False, files are publicly readable (bucket policy required). When True, URLs are signed with AWS credentials.","severity":"gotcha","affected_versions":"all"},{"fix":"Create the S3 bucket before running Django collectstatic or saving files.","message":"The library does not automatically create the S3 bucket. You must create the bucket manually or via another tool, or the storage backend will fail with a 404 error on first usage.","severity":"gotcha","affected_versions":"all"},{"fix":"Set AWS_S3_CUSTOM_DOMAIN to your CDN or S3 bucket's custom domain, and verify AWS_REGION is correct.","message":"If you use a custom domain (e.g., via AWS_S3_CUSTOM_DOMAIN), ensure that the endpoint region matches. Misconfiguration can lead to SignatureDoesNotMatch errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install django-s3-storage[boto3]","cause":"Missing dependency or incorrect Python environment.","error":"The 'django_s3_storage' package is not installed."},{"fix":"Install the package: pip install django-s3-storage","cause":"The library is not installed or not in the current Python path.","error":"ModuleNotFoundError: No module named 'django_s3_storage'"},{"fix":"Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or configure via AWS CLI.","cause":"AWS credentials are not set in environment variables or settings.","error":"botocore.exceptions.NoCredentialsError: Unable to locate credentials"},{"fix":"Ensure DEFAULT_FILE_STORAGE is defined in settings.py, not in a module-level variable that is evaluated early.","cause":"The storage backend setting is referenced before Django settings are fully loaded.","error":"django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_FILE_STORAGE, but settings are not configured."},{"fix":"Create the bucket in AWS S3 console or via AWS CLI, then verify the bucket name is correct.","cause":"The S3 bucket specified in AWS_S3_BUCKET_NAME does not exist.","error":"botocore.exceptions.ClientError: An error occurred (NoSuchBucket) when calling the PutObject operation: The specified bucket does not exist"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}