Skip to content

Commit

Permalink
Fix django storages API (#617)
Browse files Browse the repository at this point in the history
* Add staticfiles

* Fix AWS bucket routing for boto

* Try setting credentials through env vars

* Try renaming env vars?

* Set AWS region

* add back staticfiles

---------

Co-authored-by: Rohan Moniz <[email protected]>
  • Loading branch information
aviupadhyayula and rm03 authored Feb 20, 2024
1 parent da7cd50 commit dacb3b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/pennclubs/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,19 @@
EMAIL_USE_TLS = True

# Upload file storage
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")

STORAGES = {
"default": {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage",
"OPTIONS": {
"access_key": os.getenv("AWS_ACCESS_KEY_ID"),
"secret_key": os.getenv("AWS_SECRET_ACCESS_KEY"),
"bucket_name": os.getenv("AWS_STORAGE_BUCKET_NAME"),
"default_acl": "public-read",
"querystring_auth": False,
},
},
"staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"},
}

# Redis settings
Expand Down

0 comments on commit dacb3b4

Please sign in to comment.