Skip to content

Commit

Permalink
Test environment email backend setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Mihálik committed Aug 20, 2024
1 parent d99ae37 commit 89d83b2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
env:
DJANGO_EMAIL_HOST_PASSWORD: ${{ secrets.DJANGO_EMAIL_HOST_PASSWORD }}
steps:
- uses: actions/checkout@v4
- uses: wshihadeh/docker-deployment-action@v2
Expand Down
1 change: 1 addition & 0 deletions deployment/compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:

environment:
- DJANGO_SETTINGS_MODULE=webstrom.settings_test
- DJANGO_EMAIL_HOST_PASSWORD=${DJANGO_EMAIL_HOST_PASSWORD}

volumes:
- /var/run/postgresql:/var/run/postgresql:rw
Expand Down
4 changes: 2 additions & 2 deletions webstrom/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

EMAIL_VERIFICATION_TIMEOUT = 86400

MANAGERS = [('Web', 'web@strom.sk'), ]
MANAGERS = [('Web', 'webmaster@strom.sk'), ]

EMAIL_NO_REPLY = 'no-reply@strom.sk' # z tade sa odosielaju maily
EMAIL_NO_REPLY = 'web@strom.sk' # z tade sa odosielaju maily
EMAIL_ALERT = '[email protected]' # tu sa prijimaju maily
9 changes: 9 additions & 0 deletions webstrom/settings_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pylint: disable=wildcard-import,unused-wildcard-import

from os import environ

from .settings import *

DEBUG = True
Expand All @@ -21,3 +23,10 @@
}

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

EMAIL_HOST = "smtp.google.com"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = "[email protected]"
EMAIL_HOST_PASSWORD = environ["DJANGO_EMAIL_HOST_PASSWORD"]
EMAIL_TIMEOUT = 60

0 comments on commit 89d83b2

Please sign in to comment.