Team,
is this the guide i have to follow to change the storage system of multimedia files ?
when i opened environments//vault.yml it shows numbers only is this correct?
Team,
is this the guide i have to follow to change the storage system of multimedia files ?
when i opened environments//vault.yml it shows numbers only is this correct?
i have changed the localsettings.py in developer commcarehq instance as follows:
from dev_settings import *
#import os
#from storages.backends.s3boto3 import S3Boto3Storage
#from corehq.blobs.s3db import S3BlobDB
####### Database config #######
USE_PARTITIONED_DATABASE = False
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
#AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID', 'AKIAQE3RO7SAAK4H2AV3')
#AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY', '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')
#AWS_STORAGE_BUCKET_NAME = os.getenv('AWS_STORAGE_BUCKET_NAME', 'commcare-bucket')
#AWS_S3_REGION_NAME = os.getenv('AWS_S3_REGION_NAME', 'us-east-1')
#AWS_S3_ENDPOINT_URL = os.getenv('AWS_S3_ENDPOINT_URL', 'https://your-s3-compatible-service.com')
AWS_ACCESS_KEY_ID = 'XXXX'
AWS_SECRET_ACCESS_KEY = 'XXX'
AWS_STORAGE_BUCKET_NAME = 'commcare-bucket'
AWS_S3_REGION_NAME = 'us-east-1'
AWS_S3_ENDPOINT_URL='https://s3.amazonaws.com'
#MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.{AWS_S3_REGION_NAME}.your-s3-compatible-service.com/media/'
#MEDIA_ROOT = f's3://{AWS_STORAGE_BUCKET_NAME}/media/'
MEDIA_URL = 'https://commcare-bucket.s3.amazonaws.com/commcare/'
MEDIA_ROOT = 's3://commcare-bucket/commcare/'
#S3_BLOB_DB_SETTINGS = {
#"bucket": AWS_STORAGE_BUCKET_NAME,
#"region": AWS_S3_REGION_NAME,
#}
#BLOB_DB = S3BlobDB(S3_BLOB_DB_SETTINGS)
BLOB_DB = {
'default': {
'ENGINE': 'corehq.blob_db.s3db.S3BlobDB',
'BUCKET_NAME': AWS_STORAGE_BUCKET_NAME,
'AWS_ACCESS_KEY_ID': AWS_ACCESS_KEY_ID,
'AWS_SECRET_ACCESS_KEY': AWS_SECRET_ACCESS_KEY,
'AWS_S3_REGION_NAME': AWS_S3_REGION_NAME,
'AWS_S3_ENDPOINT_URL': AWS_S3_ENDPOINT_URL,
'PREFIX': 'commcare/',
}
}
#s3_blob_db_enabled= yes
if USE_PARTITIONED_DATABASE:
DATABASES.update({
'proxy': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'commcarehq_proxy',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
'PLPROXY': {
'PROXY': True
}
},
'p1': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'commcarehq_p1',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
'PLPROXY': {
'SHARDS': [0, 1],
}
},
'p2': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'commcarehq_p2',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
'PLPROXY': {
'SHARDS': [2, 3],
}
},
})
SERVER_ENVIRONMENT = 'changeme'
####### Less/Django Compressor ########
COMPRESS_ENABLED = False
COMPRESS_OFFLINE = False
####### Misc / HQ-specific Config ########
BASE_ADDRESS = 'localhost:8000'
PREVIEWER_RE = r'^.*@dimagi.com$'
MAPS_LAYERS = {
'Maps': {
'family': 'mapbox',
'args': {
'apikey': ''
}
},
'Satellite': {
'family': 'mapbox',
'args': {
'apikey': ''
}
},
}
LOCAL_APPS += (
)
LOCAL_MIDDLEWARE = [
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
]
LOCAL_PILLOWTOPS = {
}
when i am running and creating commcare dev instance and uploading the image or audio or video it is not showing to get uploaded inside S3.
@mkangia kindly suggest even though i have followed instructions it is not uplaoding the files into S3 for commcare HQ develoeper code