mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-19 22:14:07 +01:00
Connect Amazon S3 to store image
This commit is contained in:
parent
72df95242c
commit
db297c06ce
@ -227,3 +227,26 @@ LOGOUT_REDIRECT_URL = '/'
|
|||||||
AUTH_USER_MODEL = "users.CustomUser"
|
AUTH_USER_MODEL = "users.CustomUser"
|
||||||
|
|
||||||
ACCOUNT_EMAIL_REQUIRED = True
|
ACCOUNT_EMAIL_REQUIRED = True
|
||||||
|
|
||||||
|
# Storages
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID = config('AMAZON_S3_ACCESS_KEY')
|
||||||
|
AWS_SECRET_ACCESS_KEY = config('AMAZON_S3_SECRET_ACCESS_KEY')
|
||||||
|
AWS_STORAGE_BUCKET_NAME = config('BUCKET_NAME')
|
||||||
|
AWS_DEFAULT_ACL = 'public-read'
|
||||||
|
AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com'
|
||||||
|
AWS_S3_OBJECT_PARAMETERS = {'CacheControl': 'max-age=86400'}
|
||||||
|
|
||||||
|
MEDIA_URL = '/mediafiles/'
|
||||||
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles')
|
||||||
|
|
||||||
|
STORAGES = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "storages.backends.s3.S3Storage",
|
||||||
|
"OPTIONS": {
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"staticfiles": {
|
||||||
|
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -12,3 +12,5 @@ django-cors-headers>=4.3
|
|||||||
google_api_python_client>=2.1
|
google_api_python_client>=2.1
|
||||||
google_auth_oauthlib>=1.1
|
google_auth_oauthlib>=1.1
|
||||||
google-auth-httplib2>=0.1
|
google-auth-httplib2>=0.1
|
||||||
|
django-storages[s3]>=1.14
|
||||||
|
Pillow>=10.1
|
||||||
Loading…
Reference in New Issue
Block a user