File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ services:
1616 - .envs/.example
1717 environment :
1818 - USE_GRANIAN=True
19+ - USE_POSTGRES=True
1920 healthcheck :
2021 test : ["CMD-SHELL", "curl -f http://localhost:8000/api/v1/status || exit 1"]
2122 interval : 1m30s
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ USE_GRANIAN=${USE_GRANIAN:-true}
55USE_GRANIAN=$( echo " $USE_GRANIAN " | tr ' [:upper:]' ' [:lower:]' )
66
77uv pip list
8- python src/manage.py collectstatic --no-input
8+ python src/manage.py collectstatic --no-input --clear
99python src/manage.py migrate
1010sphinx-build docs/ build/
1111python src/manage.py compilemessages --ignore .venv --ignore cache
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ def debug(_):
334334 "BACKEND" : "config.storage_backends.PublicMediaStorage" ,
335335 },
336336 "staticfiles" : {
337- "BACKEND" : "config.storage_backends.StaticStorage " ,
337+ "BACKEND" : "config.storage_backends.ManifestStaticStorage " ,
338338 },
339339 }
340340
Original file line number Diff line number Diff line change 11from django .conf import settings
22from storages .backends .s3boto3 import S3Boto3Storage
3+ from storages .backends .s3boto3 import S3ManifestStaticStorage as BaseManifestStaticStorage
4+ from storages .backends .s3boto3 import S3StaticStorage
35
46
5- class StaticStorage (S3Boto3Storage ):
7+ class StaticStorage (S3StaticStorage ):
68 location = settings .AWS_STATIC_LOCATION
79
810
11+ class ManifestStaticStorage (BaseManifestStaticStorage ):
12+ location = settings .AWS_STATIC_LOCATION
13+
14+ def get_object_parameters (self , name ):
15+ params = super ().get_object_parameters (name )
16+ params ["CacheControl" ] = "max-age=31536000"
17+ return params
18+
19+
920class PublicMediaStorage (S3Boto3Storage ):
1021 location = settings .AWS_PUBLIC_MEDIA_LOCATION
1122 file_overwrite = False
You can’t perform that action at this time.
0 commit comments