Skip to content

Commit 874b70c

Browse files
committed
Add more comments
1 parent c644d84 commit 874b70c

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

core/templatetags/custom_static.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
@register.simple_tag
88
def large_static(file_path: str):
9+
"""
10+
Automatically handles serving large static content based on development vs. production.
11+
12+
Serves specified content from the local large static file is LOCAL_DEVELOPMENT is True, else serves
13+
from the static content in S3.
14+
"""
915
# Strip any leading slashes to avoid footguns
1016
file_path = file_path.lstrip("/")
1117
if settings.LOCAL_DEVELOPMENT:

justfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ alias shell := console
184184
docker compose run --rm web python manage.py {{ args }}
185185

186186
# Static File Management
187-
@down_sync_images BUCKET='stage.boost.org.v2': ## syncs all items from specified bucket to static/static-large for local development
187+
@down_sync_images BUCKET='stage.boost.org.v2': ## syncs all items from specified bucket to static/static-large for local development. See scripts/upload-images.sh for required vars.
188+
if ! command -v aws &>/dev/null; then \
189+
echo "awscli is required. Please install it from https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"; \
190+
exit 1; \
191+
fi
192+
188193
if echo {{VALID_BUCKETS}} | grep -q -w '{{BUCKET}}'; then \
189194
aws s3 sync s3://{{BUCKET}}/static/ static/static-large/; \
190195
echo "All missing or outdated static items synced."; \

0 commit comments

Comments
 (0)