File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77@register .simple_tag
88def 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 :
Original file line number Diff line number Diff 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." ; \
You can’t perform that action at this time.
0 commit comments