Commit 7b53e99930cfd6503d5ccbfaf291107106de6a53

Authored by Alexis Koralewski
1 parent d8b6bc10
Exists in dev

Enable real email when in prod (settings.py)

Showing 2 changed files with 14 additions and 2 deletions   Show diff stats
CHANGELOG
1 1 04-04-2023 (AKo): v0.6.21.0
2 2 - Improve check of ObsConfig load function and renaming functions of ObsConfig & PyrosUser
3 3 - Add schema (Md file) to explain workflow when user import a sequence file
  4 + - Enable real email when in prod (settings.py)
4 5  
5 6 20-03-2023 (AKo): v0.6.20.0
6 7 - Add night_id to sequences, create folder for night_id
... ...
src/core/pyros_django/pyros/settings.py
... ... @@ -231,9 +231,14 @@ INSTALLED_APPS = [
231 231 'obsconfig',
232 232 'dashboard',
233 233 "api",
  234 + #"silk",
234 235 #'kombu.transport.django'
235 236 ]
236 237  
  238 +#silk
  239 +
  240 +#SILKY_PYTHON_PROFILER = True
  241 +
237 242 CHANNEL_LAYERS = {
238 243 "default": {
239 244  
... ... @@ -263,7 +268,8 @@ MIDDLEWARE = [
263 268 'django.middleware.clickjacking.XFrameOptionsMiddleware',
264 269 # For debug_toolbar
265 270 'debug_toolbar.middleware.DebugToolbarMiddleware',
266   -
  271 + # silk
  272 + #"silk.middleware.SilkyMiddleware",
267 273 ]
268 274  
269 275 ROOT_URLCONF = 'pyros.urls'
... ... @@ -493,7 +499,12 @@ else:
493 499 # from django.core.cache import cache
494 500 # cache.clear()
495 501  
496   -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  502 +if os.environ.get("IS_PROD") and os.environ.get("IS_PROD") == True :
  503 + # If in prod, use real email
  504 + EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  505 +else:
  506 + # else email aren't sent and are print in console instead
  507 + EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
497 508  
498 509 python_version = subprocess.run( "python --version | cut -d ' ' -f 2 | cut -d '.' -f 1,2",shell=True,stdout=subprocess.PIPE,universal_newlines=True)
499 510 python_version = python_version.stdout
... ...