AFAIK, str casts the type to String immediately, whereas get tries to detect the type, either way it has no practical difference in this case, so long as the result doesn’t raise an error when the value isn’t present, because it will only be present in production environment.
Here’s the link to the crowdbotics-django-scaffold, I’m fairly certain your project is using the latest version. We don’t include S3Boto by default since not all projects will be using it but might benefit from a smaller footprint in deployment.
Hi @dmitrii.k Thank you. I’ve put those parameters into the settings this way:
AWS_ACCESS_KEY_ID = os.getenv(‘AWS_ACCESS_KEY_ID’)
AWS_SECRET_ACCESS_KEY = os.getenv(‘AWS_SECRET_ACCESS_KEY’)
AWS_STORAGE_BUCKET_NAME = os.getenv(‘AWS_STORAGE_BUCKET_NAME’)
AWS_STORAGE_REGION = os.getenv(‘AWS_STORAGE_REGION’)
AWS_LOCATION = ‘static’
and I have installed the django-boto, django-storages, boto3, botocore packages. But I still don’t have files in the static folder. Could you please provide the access to the AWS dashboard that I can check is my images there and how I can retrieve them?
Make sure you also specify the AWS_DEFAULT_ACL as public-read (or pass ACL configuration to Boto3 specifically), or your files will not be accessible to your users (unless you generate pre-signed URLs).
Hi @dmitrii.k I’ve updated settings, it looks this now:
AWS_ACCESS_KEY_ID = os.getenv(‘AWS_ACCESS_KEY_ID’)
AWS_SECRET_ACCESS_KEY = os.getenv(‘AWS_SECRET_ACCESS_KEY’)
AWS_STORAGE_BUCKET_NAME = os.getenv(‘AWS_STORAGE_BUCKET_NAME’)
AWS_STORAGE_REGION = os.getenv(‘AWS_STORAGE_REGION’)
AWS_DEFAULT_ACL = ‘public-read’
DEFAULT_FILE_STORAGE = ‘storages.backends.s3boto3.S3Boto3Storage’
But I’m still getting error from saving pictures. Please have a look on those screenshots. Could you please advise me what could be wrong?