Skip to content

Commit

Permalink
Merge pull request #168 from numerique-gouv/email-settings
Browse files Browse the repository at this point in the history
[Config] Gestion de l’envoi de courriels de récupération de mot de passe
  • Loading branch information
Ash-Crow authored Jun 25, 2024
2 parents 89855fd + 633bbf0 commit 2e85859
Show file tree
Hide file tree
Showing 13 changed files with 526 additions and 315 deletions.
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ S3_BUCKET_NAME=
S3_BUCKET_REGION=eu-west-3
# S3_LOCATION: If the S3 bucket is shared, add a unique folder name
S3_LOCATION=

# (optional) Email settings
DEFAULT_FROM_EMAIL=
EMAIL_HOST=
EMAIL_PORT=
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_USE_TLS=
EMAIL_USE_SSL=
EMAIL_TIMEOUT=30
EMAIL_SSL_KEYFILE=
EMAIL_SSL_CERTFILE=
WAGTAIL_PASSWORD_RESET_ENABLED=False
# WAGTAIL_PASSWORD_RESET_ENABLED: set to true to be able to send the email
# from the DEFAULT_FROM_EMAIL through the defined SMTP parameters
Binary file modified blog/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
50 changes: 25 additions & 25 deletions blog/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-04 15:08+0200\n"
"PO-Revision-Date: 2024-06-04 15:17+0200\n"
"POT-Creation-Date: 2024-06-24 12:44+0200\n"
"PO-Revision-Date: 2024-06-24 12:44+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
Expand All @@ -18,19 +18,19 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.4.2\n"

#: blog/blocks.py:9 blog/models.py:290
#: blog/blocks.py:9 blog/models.py:289
msgid "Name"
msgstr "Nom"

#: blog/blocks.py:10 blog/models.py:291
#: blog/blocks.py:10 blog/models.py:290
msgid "Role"
msgstr "Fonction"

#: blog/blocks.py:11 blog/models.py:292
#: blog/blocks.py:11 blog/models.py:291
msgid "Organization"
msgstr "Organisation"

#: blog/blocks.py:12 blog/models.py:293
#: blog/blocks.py:12 blog/models.py:292
msgid "Contact info"
msgstr "Informations de contact"

Expand All @@ -42,81 +42,81 @@ msgstr "Texte riche"
msgid "Contact card"
msgstr "Carte contact"

#: blog/models.py:36
#: blog/models.py:35
msgid "Posts per page"
msgstr "Articles par page"

#: blog/models.py:46
#: blog/models.py:45
msgid "Blog index"
msgstr "Index de blog"

#: blog/models.py:74 blog/templates/blog/tags_list_page.html:20
#: blog/models.py:73 blog/templates/blog/tags_list_page.html:20
#: blog/views.py:149
msgid "Tags"
msgstr "Étiquettes"

#: blog/models.py:97 blog/models.py:170 blog/models.py:265
#: blog/models.py:96 blog/models.py:169 blog/models.py:264
#: blog/templates/blog/categories_list_page.html:20 blog/views.py:117
msgid "Categories"
msgstr "Catégories"

#: blog/models.py:109 blog/templates/blog/blog_index_page.html:59
#: blog/models.py:108 blog/templates/blog/blog_index_page.html:59
msgid "Posts written by"
msgstr "Articles écrits par"

#: blog/models.py:172
#: blog/models.py:171
msgid "Post date"
msgstr "Date de publication"

#: blog/models.py:174
#: blog/models.py:173
msgid "Author entries can be created in Snippets > Persons"
msgstr "Les auteurs peuvent être créés via Fragments > Personnes"

#: blog/models.py:193
#: blog/models.py:192
msgid "Scheduled publishing"
msgstr "Publication planifiée"

#: blog/models.py:201
#: blog/models.py:200
msgid "Tags and Categories"
msgstr "Étiquettes et Catégories"

#: blog/models.py:209
#: blog/models.py:208
msgid "Blog page"
msgstr "Page de blog"

#: blog/models.py:214
#: blog/models.py:213
msgid "Category name"
msgstr "Nom de la catégorie"

#: blog/models.py:221
#: blog/models.py:220
msgid "Parent category"
msgstr "Catégorie parente"

#: blog/models.py:227
#: blog/models.py:226
msgid "Description"
msgstr "Description"

#: blog/models.py:228
#: blog/models.py:227
msgid "Displayed on the top of the category page"
msgstr "Affiché en haut de la page de la catégorie"

#: blog/models.py:234
#: blog/models.py:233
msgid "Text displayed at the end of every page in the category"
msgstr "Texte affiché à la fin de chaque page de la catégorie"

#: blog/models.py:245
#: blog/models.py:244
msgid "Parent category cannot be self."
msgstr "La catégorie ne peut être sa propre parente."

#: blog/models.py:247
#: blog/models.py:246
msgid "Cannot have circular Parents."
msgstr "Il est impossible d’avoir des parents circulaires."

#: blog/models.py:264 blog/models.py:276
#: blog/models.py:263 blog/models.py:275
msgid "Category"
msgstr "Catégorie"

#: blog/models.py:310
#: blog/models.py:309
msgid "Person"
msgstr "Personne"

Expand Down
22 changes: 18 additions & 4 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def show_toolbar(request):

WSGI_APPLICATION = "config.wsgi.application"


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases

Expand Down Expand Up @@ -177,9 +176,6 @@ def show_toolbar(request):
},
]

WAGTAIL_PASSWORD_RESET_ENABLED = os.getenv("WAGTAIL_PASSWORD_RESET_ENABLED", False)


# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/

Expand Down Expand Up @@ -310,6 +306,24 @@ def show_toolbar(request):

WAGTAILIMAGES_EXTENSIONS = ["gif", "jpg", "jpeg", "png", "webp", "svg"]

# Email settings
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", "")

if DEFAULT_FROM_EMAIL:
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = os.getenv("EMAIL_HOST", None)
EMAIL_PORT = os.getenv("EMAIL_PORT", None)
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", None)
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", None)
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", None)
EMAIL_USE_SSL = os.getenv("EMAIL_USE_SSL", None)
EMAIL_TIMEOUT = int(os.getenv("EMAIL_TIMEOUT", 30))
EMAIL_SSL_KEYFILE = os.getenv("EMAIL_SSL_KEYFILE", None)
EMAIL_SSL_CERTFILE = os.getenv("EMAIL_SSL_CERTFILE", None)

WAGTAIL_PASSWORD_RESET_ENABLED = os.getenv("WAGTAIL_PASSWORD_RESET_ENABLED", False)

# CSRF
CSRF_TRUSTED_ORIGINS = []
for host in ALLOWED_HOSTS:
CSRF_TRUSTED_ORIGINS.append("https://" + host)
Binary file modified content_manager/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 2e85859

Please sign in to comment.