From 3386db054a8322af43fbdca18f98f9d57c3ebb2b Mon Sep 17 00:00:00 2001 From: wcui64 Date: Sun, 7 Jan 2024 22:20:33 -0500 Subject: [PATCH 1/4] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6bb1d1f..8ebd3b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ pytz==2022.1 sqlparse==0.4.2 django-rest-knox==4.2.0 drf_yasg==1.21.4 -django-mailinglist==0.1.5 \ No newline at end of file +django-mailinglist==0.1.5 +sorl-thumbnail==12.10.0 \ No newline at end of file From 86e95ff3939236b5f732c48b8bc5fb19eeb798cd Mon Sep 17 00:00:00 2001 From: wcui64 Date: Sun, 7 Jan 2024 22:41:28 -0500 Subject: [PATCH 2/4] Update requirements.txt --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1b690fc..8ebd3b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,5 +11,4 @@ sqlparse==0.4.2 django-rest-knox==4.2.0 drf_yasg==1.21.4 django-mailinglist==0.1.5 -sorl-thumbnail==12.10.0 - +sorl-thumbnail==12.10.0 \ No newline at end of file From 4b45b1a8bacef40e49924435e0d36f751d417d9d Mon Sep 17 00:00:00 2001 From: wcui64 Date: Sun, 7 Jan 2024 22:47:52 -0500 Subject: [PATCH 3/4] mailinglist added added django-mailinglist to enable newsletter subscription. --- nextServer/settings.py | 20 ++++++++++++++++++++ nextServer/urls.py | 1 + 2 files changed, 21 insertions(+) diff --git a/nextServer/settings.py b/nextServer/settings.py index 6331281..cda93a8 100644 --- a/nextServer/settings.py +++ b/nextServer/settings.py @@ -53,6 +53,9 @@ 'apps.post', 'accounts', 'knox', + 'django.contrib.sites', + 'sorl.thumbnail', + 'mailinglist', ] if DEBUG: INSTALLED_APPS += ['drf_yasg'] @@ -69,6 +72,8 @@ ROOT_URLCONF = 'nextServer.urls' +SITE_ID = 1# Adjust this ID based on your site's ID in the database + TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -87,6 +92,8 @@ WSGI_APPLICATION = 'nextServer.wsgi.application' +NEWSLETTER_THUMBNAIL = 'sorl-thumbnail' + # Database # https://docs.djangoproject.com/en/4.0/ref/settings/#databases @@ -156,6 +163,19 @@ ], } +# email SMTP setting +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp-mail.outlook.com' # or your Outlook SMTP server address +EMAIL_PORT = 587 # Outlook SMTP port +EMAIL_USE_TLS = True # Use TLS encryption +EMAIL_HOST_USER = 'no-reply@gisphere.info' # Your Outlook email address +# EMAIL_HOST_PASSWORD = # Your Outlook email password or app password +DEFAULT_FROM_EMAIL = 'no-reply@gisphere.info' + +MAILINGLIST_BASE_URL = "https://www.gisphere.info" # NO TRAILING SLASH PLEASE +MAILINGLIST_DEFAULT_SENDER_EMAIL = "no-reply@gisphere.info" + + # LOGGING_DIR = BASE_DIR.joinpath("logs") # debug_log_dir = LOGGING_DIR / "debug" # info_log_dir = LOGGING_DIR / "info" diff --git a/nextServer/urls.py b/nextServer/urls.py index 9e4848e..a59d0fd 100644 --- a/nextServer/urls.py +++ b/nextServer/urls.py @@ -35,6 +35,7 @@ path('api/', include("apps.post.urls")), path('api/', include("apps.school.urls")), path('', include('accounts.urls')), + path("mailinglist/", include("mailinglist.urls", namespace="mailinglist")), ] if settings.DEBUG: urlpatterns += [path('', include('app.apis.swagger.urls')), From 07f81bd73b3fc784a7c5a6f6285503bb6a963788 Mon Sep 17 00:00:00 2001 From: wcui64 Date: Sun, 7 Jan 2024 22:51:34 -0500 Subject: [PATCH 4/4] Update settings.py --- nextServer/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextServer/settings.py b/nextServer/settings.py index cda93a8..e9edf8d 100644 --- a/nextServer/settings.py +++ b/nextServer/settings.py @@ -169,7 +169,7 @@ EMAIL_PORT = 587 # Outlook SMTP port EMAIL_USE_TLS = True # Use TLS encryption EMAIL_HOST_USER = 'no-reply@gisphere.info' # Your Outlook email address -# EMAIL_HOST_PASSWORD = # Your Outlook email password or app password +EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD') # Your Outlook email password or app password DEFAULT_FROM_EMAIL = 'no-reply@gisphere.info' MAILINGLIST_BASE_URL = "https://www.gisphere.info" # NO TRAILING SLASH PLEASE