问题
So when I go to re-deploy my heroku, some of my profiles are missing photos, and the same ones every single time. When I upload a user photo, I can see a copy of it being put into my AWS bucket. And it uploads and shows up. But when I re-deploy, it's gone. Why is this happening?
settings.py
STATIC_URL = '/static/'
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticfiles')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
#Settings for django-bootstrap3
BOOTSTRAP4 = {
'include_jquery' : True,
}
#S3 BUCKETS CONFIG
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATIC_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
来源:https://stackoverflow.com/questions/62723278/why-are-some-of-my-photos-missing-after-i-re-deploy-heroku-even-though-i-have-s3