This repository has been archived by the owner on Jan 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuring static/media to point to S3
At time of this commit there are outstanding PRs that will fix the usage of iam roles instead of just regular accounts. See jschneier/django-storages#282. Instead of forking the library with those changes I made a work-around by setting the problematic logic to False. Its a misleading addition since those attributes actually do get sucked in via env vars.
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django.conf import settings | ||
from storages.backends.s3boto3 import S3Boto3Storage | ||
|
||
|
||
class StaticStorage(S3Boto3Storage): | ||
location = settings.AWS_S3_STATIC_PATH | ||
access_key = False | ||
secret_key = False | ||
|
||
|
||
class MediaStorage(S3Boto3Storage): | ||
location = settings.AWS_S3_MEDIA_PATH | ||
access_key = False | ||
secret_key = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters