Skip to content

Commit

Permalink
Merge pull request #140 from betagouv/emails-and-file-storage
Browse files Browse the repository at this point in the history
Gestion du stockage fichiers via django-storages
  • Loading branch information
pletelli authored Jan 25, 2024
2 parents a2e3117 + 5158def commit 785bdfd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
17 changes: 12 additions & 5 deletions icare/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

# Media and file storage
AWS_ACCESS_KEY_ID = os.getenv("CELLAR_KEY")
AWS_SECRET_ACCESS_KEY = os.getenv("CELLAR_SECRET")
AWS_S3_ENDPOINT_URL = os.getenv("CELLAR_HOST")
AWS_STORAGE_BUCKET_NAME = os.getenv("CELLAR_BUCKET_NAME")
AWS_LOCATION = "media"
AWS_QUERYSTRING_AUTH = False

DEFAULT_FILE_STORAGE = os.getenv("DEFAULT_FILE_STORAGE")
MEDIA_ROOT = os.getenv("MEDIA_ROOT", os.path.join(BASE_DIR, "media"))
MEDIA_URL = "/media/"
Expand All @@ -184,6 +191,11 @@
EMAIL_HOST = "localhost"
EMAIL_PORT = 1025

NEWSLETTER_BREVO_LIST_ID = os.getenv("NEWSLETTER_BREVO_LIST_ID")
ANYMAIL = {
"SENDINBLUE_API_KEY": os.getenv("BREVO_API_KEY", ""),
}

# Rest framework

REST_FRAMEWORK = {
Expand Down Expand Up @@ -232,11 +244,6 @@
},
}

NEWSLETTER_BREVO_LIST_ID = os.getenv("NEWSLETTER_BREVO_LIST_ID")
ANYMAIL = {
"SENDINBLUE_API_KEY": os.getenv("BREVO_API_KEY", ""),
}

# CK Editor
CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
Expand Down
20 changes: 16 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
aiohttp==3.9.1
aiosignal==1.3.1
asgiref==3.7.2
astroid==3.0.2
async-timeout==4.0.3
attrs==23.1.0
black==23.12.1
boto3==1.34.26
botocore==1.34.26
certifi==2023.11.17
cffi==1.16.0
cfgv==3.4.0
Expand All @@ -15,22 +21,26 @@ django-ckeditor==6.7.0
django-filter==23.5
django-js-asset==2.2.0
django-simple-history==3.4.0
django-webpack-loader==3.0.1
django-storages==1.14.2
django-webpack-loader==3.0.0
djangorestframework==3.14.0
djangorestframework-camel-case==1.4.2
drf-base64==2.0
factory-boy==3.3.0
Faker==22.4.0
Faker==22.2.0
filelock==3.13.1
frozenlist==1.4.1
identify==2.5.33
idna==3.6
isort==5.13.2
jmespath==1.0.1
mccabe==0.7.0
multidict==6.0.4
mypy-extensions==1.0.0
nodeenv==1.8.0
packaging==23.2
pathspec==0.12.1
Pillow==10.2.0
pillow==10.2.0
pipdeptree==2.13.2
platformdirs==4.1.0
pre-commit==3.6.0
Expand All @@ -45,11 +55,13 @@ pytz==2023.3.post1
PyYAML==6.0.1
requests==2.31.0
requests-mock==1.11.0
s3transfer==0.10.0
sib-api-v3-sdk==7.6.0
six==1.16.0
sqlparse==0.4.4
tomli==2.0.1
tomlkit==0.12.3
typing_extensions==4.9.0
urllib3==2.1.0
urllib3==2.0.7
virtualenv==20.25.0
yarl==1.9.4

0 comments on commit 785bdfd

Please sign in to comment.