[GeoNode-users] Define email service on GeoNode

Alessio Fabiani alessio.fabiani at geo-solutions.it
Fri May 22 00:46:04 PDT 2020


Hi Jose,
in GeoNode the recommended way is to use environment variables always.
There is logic on original settings which depends on some env values. That
means that it is not simply matter to override a variable sometimes.

In your case I guess the error is that the values of end on docker-compose
and uwsgi do not require quotes nor double quotes except in very special
cases when you have characters that conflicts with the shell.

-A.



Il giorno gio 21 mag 2020 alle ore 23:38 Jose Cáceres <jose.atyus at gmail.com>
ha scritto:

> 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
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>


-- 

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==
Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead


GeoSolutions S.A.S.
Via di Montramito 3/A - 55054  Massarosa (LU) - Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39 331 6233686


http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.


This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200522/8ab8342b/attachment-0001.html>


More information about the geonode-users mailing list