Aggiorno dall'upstream
This commit is contained in:
@@ -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 *
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user