[GeoNode-users] Define email service on GeoNode

Jose Cáceres jose.atyus at gmail.com
Thu May 21 14:38:03 PDT 2020


Hi,

I'm running Geonode on Docker.

I'm having troubles configuring the mail service for Geonode. I was able to
have it up and running by defining the values directly on my settings.py
file, like this:






*EMAIL_ENABLE = ast.literal_eval(os.getenv('EMAIL_ENABLE', 'True'))if
EMAIL_ENABLE:    EMAIL_BACKEND = os.getenv('DJANGO_EMAIL_BACKEND',
                    default='django.core.mail.backends.smtp.EmailBackend')
  EMAIL_HOST = os.getenv('DJANGO_EMAIL_HOST', '*smtp.gmail.com







*')    EMAIL_PORT = os.getenv('DJANGO_EMAIL_PORT', 587)    EMAIL_HOST_USER
= os.getenv('DJANGO_EMAIL_HOST_USER', 'my_mail at gmail.com
<my_mail at gmail.com>')    EMAIL_HOST_PASSWORD =
os.getenv('DJANGO_EMAIL_HOST_PASSWORD', 'mypassword')    EMAIL_USE_TLS =
ast.literal_eval(os.getenv('DJANGO_EMAIL_USE_TLS', 'True'))
DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL', 'GeoNode
<no-reply at geonode.org <no-reply at geonode.org>>')else:    EMAIL_BACKEND =
os.getenv('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend')*

This way I was able to deliver messages to users, send notifications, etc.

But I don't want to have those values available on the settings.py, so I
figure I could add the variales to my docker-compose file, like this:




*DJANGO_EMAIL_HOST='smtp.gmail.com
<http://smtp.gmail.com>'DJANGO_EMAIL_PORT=587DJANGO_EMAIL_HOST_USER='my_mail at gmail.com
<my_mail at gmail.com>'DJANGO_EMAIL_HOST_PASSWORD='my password'*

And I left the values on the settings.py by default:














*EMAIL_ENABLE = ast.literal_eval(os.getenv('EMAIL_ENABLE', 'False'))if
EMAIL_ENABLE:    EMAIL_BACKEND = os.getenv('DJANGO_EMAIL_BACKEND',
                    default='django.core.mail.backends.smtp.EmailBackend')
  EMAIL_HOST = os.getenv('DJANGO_EMAIL_HOST', 'localhost')    EMAIL_PORT =
os.getenv('DJANGO_EMAIL_PORT', 25)    EMAIL_HOST_USER =
os.getenv('DJANGO_EMAIL_HOST_USER', '')    EMAIL_HOST_PASSWORD =
os.getenv('DJANGO_EMAIL_HOST_PASSWORD', '')    EMAIL_USE_TLS =
ast.literal_eval(os.getenv('DJANGO_EMAIL_USE_TLS', 'False'))
DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL', 'GeoNode
<no-reply at geonode.org <no-reply at geonode.org>>')else:    EMAIL_BACKEND =
os.getenv('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend')*

But this way is not working, messages are not sent.

So I want to ask you what is the best way to configure the mail service.

Thanks in advanced.

José


-- 
José David Cáceres
Ingeniero Ambiental
Máster en Tecnologías de la Información Geográfica
e-mail: jose.atyus at gmail.com



[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
Remitente
notificado con
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
21/05/20
15:36:45
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200521/1c2b93b8/attachment.html>


More information about the geonode-users mailing list