From af1fc43c3cab6704669713b3115ff8b65a9cbaa0 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Sun, 1 Dec 2024 14:32:45 +0000 Subject: [PATCH] fix: static folder --- .deploy/static.json | 3 ++- Pipfile | 2 +- Pipfile.lock | 13 ++++++++++++- settings.py | 5 +++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.deploy/static.json b/.deploy/static.json index 63bfd38..a8a7761 100644 --- a/.deploy/static.json +++ b/.deploy/static.json @@ -1,4 +1,5 @@ { "artifactUrl": "REPLACE_IN_PIPELINE", - "assetsPrefix": "REPLACE_IN_PIPELINE" + "assetsPrefix": "REPLACE_IN_PIPELINE", + "bucket": "REPLACE_IN_PIPELINE" } diff --git a/Pipfile b/Pipfile index 2d2cd82..8aa6845 100644 --- a/Pipfile +++ b/Pipfile @@ -2,7 +2,6 @@ url = "https://pypi.org/simple" verify_ssl = true name = "pypi" - ## ℹ️ HOW-TO: Make the python-package editable. # # 1. Comment out the non-editable codeforlife package under [packages]. @@ -25,6 +24,7 @@ name = "pypi" [packages] codeforlife = "==0.23.0" # 🚫 Don't add [packages] below that are inherited from the CFL package. +django-storages = {version = "==1.14.4", extras = ["s3"]} [dev-packages] codeforlife = {version = "==0.23.0", extras = ["dev"]} diff --git a/Pipfile.lock b/Pipfile.lock index 91bd395..1fa962b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "4adb759eabc77596cfebd07a1617749a29ff19858dcd0a755d47da844f34b14f" + "sha256": "82b1712c954fb48d0586cf1a7bfd2b819f075021962b47b610303febb4e2dc71" }, "pipfile-spec": 6, "requires": { @@ -315,6 +315,17 @@ ], "version": "==2.0.0" }, + "django-storages": { + "extras": [ + "s3" + ], + "hashes": [ + "sha256:69aca94d26e6714d14ad63f33d13619e697508ee33ede184e462ed766dc2a73f", + "sha256:d61930acb4a25e3aebebc6addaf946a3b1df31c803a6bf1af2f31c9047febaa3" + ], + "markers": "python_version >= '3.7'", + "version": "==1.14.4" + }, "django-treebeard": { "hashes": [ "sha256:83aebc34a9f06de7daaec330d858d1c47887e81be3da77e3541fe7368196dd8a" diff --git a/settings.py b/settings.py index 28f2fd3..e63059e 100644 --- a/settings.py +++ b/settings.py @@ -60,3 +60,8 @@ # https://docs.djangoproject.com/en/3.2/howto/static-files/ STATIC_ROOT = get_static_root(BASE_DIR) + +# TODO: move to cfl package +AWS_STORAGE_BUCKET_NAME = "use1-static-dev-725778237416" +STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/assets/v1/dev/atm/cflcontributorbackend" +DEFAULT_FILE_STORAGE = "storages.backends.s3.S3Storage"