Aggiorno dall'upstream

This commit is contained in:
Davide Borgonovo
2024-07-23 17:25:27 +02:00
parent 900978936e
commit 79de619503
28 changed files with 165 additions and 68 deletions
+1 -1
View File
@@ -2,5 +2,5 @@
# And running the server are different
# (Possibly due to test_project being within a subfolder)
# This defaults settings to local unless
# DJANGO_SETTINGS is specified.
# DJANGO_SETTINGS_MODULE is specified.
from .local import *
+9 -5
View File
@@ -138,15 +138,17 @@ if USE_S3:
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY", "test")
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME", "mybucket")
AWS_DEFAULT_ACL = None
AWS_S3_CUSTOM_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com"
# AWS_S3_CUSTOM_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com"
AWS_S3_OBJECT_PARAMETERS = {"CacheControl": "max-age=86400"}
# s3 static settings
STATIC_LOCATION = "static"
STATIC_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/{STATIC_LOCATION}/"
STATIC_LOCATION = "staticfiles"
STATIC_URL = f"{AWS_S3_ENDPOINT_URL}/{STATIC_LOCATION}/"
STATIC_ROOT = os.path.join(BASE_DIR, STATIC_LOCATION)
STATICFILES_STORAGE = "tests.storage_backends.StaticStorage"
# s3 public media settings
PUBLIC_MEDIA_LOCATION = "media"
MEDIA_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/{PUBLIC_MEDIA_LOCATION}/"
PUBLIC_MEDIA_LOCATION = "mediafiles"
MEDIA_URL = f"{AWS_S3_ENDPOINT_URL}/{PUBLIC_MEDIA_LOCATION}/"
MEDIA_ROOT = os.path.join(BASE_DIR, PUBLIC_MEDIA_LOCATION)
DEFAULT_FILE_STORAGE = "tests.storage_backends.PublicMediaStorage"
else:
STATIC_URL = "/staticfiles/"
@@ -155,3 +157,5 @@ else:
MEDIA_ROOT = os.path.join(BASE_DIR, "mediafiles")
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
+3 -1
View File
@@ -4,4 +4,6 @@ INSTALLED_APPS = INSTALLED_APPS + ["market"]
WSGI_APPLICATION = "test_project.wsgi.application"
ROOT_URLCONF = "test_project.urls"
USE_S3 = "True"
if USE_S3:
STATICFILES_STORAGE = "storage_backends.StaticStorage"
DEFAULT_FILE_STORAGE = "storage_backends.PublicMediaStorage"
-2
View File
@@ -3,5 +3,3 @@ from .base import *
INSTALLED_APPS = INSTALLED_APPS + ["tests.market"]
WSGI_APPLICATION = "tests.test_project.wsgi.application"
ROOT_URLCONF = "tests.test_project.urls"
USE_S3 = "True"