Skip to content

Commit

Permalink
openshift adjustments (#295)
Browse files Browse the repository at this point in the history
* Add location to GlossVideoStorage

Acts as a base path

* add staticfiles storage in order to add prefix path

* change staticfiles_storage in settings
  • Loading branch information
henrinie authored Sep 1, 2024
1 parent c09f190 commit 5d26c9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion signbank/settings/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
)

DEFAULT_FILE_STORAGE = "storages.backends.s3.S3Storage"
STATICFILES_STORAGE = "storages.backends.s3.S3Storage"
STATICFILES_STORAGE = "signbank.utils.StaticFilesStorage"

AWS_STORAGE_BUCKET_NAME = os.environ.get("BUCKET_NAME", "")
AWS_S3_ENDPOINT_URL = os.environ.get("BUCKET_ENDPOINT_URL", "")
Expand Down
4 changes: 4 additions & 0 deletions signbank/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from storages.backends.s3 import S3Storage

class StaticFilesStorage(S3Storage):
location = "static"
3 changes: 3 additions & 0 deletions signbank/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
class GlossVideoStorage(SignbankStorage):
"""Video storage, handles saving to directories based on filenames first two characters."""

# Used for S3Storage
location = "media"

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.base_path = "media/"
Expand Down

0 comments on commit 5d26c9f

Please sign in to comment.