remove secrets from settings

This commit is contained in:
Laetitia Getti 2023-08-07 15:22:51 +02:00
parent 289a872618
commit 027476c2c4
3 changed files with 22 additions and 6 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ node_modules
/media/*
local_settings.py
.venv
mails.sqlite

View file

@ -174,10 +174,19 @@ if SENTRY_DSN:
# Email settings
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = os.getenv("EMAIL_HOST", "smtp.sendgrid.net")
EMAIL_HOST = os.getenv("EMAIL_HOST")
EMAIL_PORT = int(os.getenv("EMAIL_PORT", "587"))
DEFAULT_FROM_EMAIL = os.getenv("DJANGO_DEFAULT_FROM_EMAIL", "laetitia@chariotte.fr")
DEFAULT_FROM_EMAIL = os.getenv(
"DJANGO_DEFAULT_FROM_EMAIL", "La Chariotte <notification@chariotte.fr>"
)
DEFAULT_FROM_EMAIL_NAME = os.getenv("DJANGO_DEFAULT_FROM_EMAIL_NAME", "La Chariotte")
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "apikey")
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER")
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD")
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", "True") == "True"
if DEBUG:
EMAIL_HOST = "127.0.0.1"
EMAIL_HOST_USER = ""
EMAIL_HOST_PASSWORD = ""
EMAIL_PORT = 1025
EMAIL_USE_TLS = False

View file

@ -17,7 +17,8 @@ Including another URLconf
from django.contrib import admin
from django.contrib.auth.views import (PasswordResetCompleteView,
PasswordResetConfirmView,
PasswordResetDoneView)
PasswordResetDoneView,
PasswordResetView)
from django.urls import include, path
from django.views.generic.base import TemplateView
@ -27,7 +28,12 @@ urlpatterns = [
path("admin/", admin.site.urls),
path("commande/", include("la_chariotte.order.urls")),
path("comptes/", include("la_chariotte.accounts.urls")),
# paths for accounts that are easier to leave here
# Some paths for accounts are easier to leave here
# - PasswordResetView sends the mail
# - PasswordResetDoneView shows a success message for the above
# - PasswordResetConfirmView checks the link the user clicked and
# prompts for a new password
# - PasswordResetCompleteView shows a success message for the above
path(
"comptes/reset/<uidb64>/<token>/",
PasswordResetConfirmView.as_view(),