platformsh-templates / django4

Django 4 template starter for Platform.sh
14 stars 10 forks source link

add email configuration #774

Open lsmith77 opened 4 months ago

lsmith77 commented 4 months ago

What in this template can be improved or added as a feature?

Currently the settings.py is missing settings for email: https://docs.djangoproject.com/en/4.0/topics/email/

What exactly should be updated?

EMAIL_HOST = os.getenv("PLATFORM_SMTP_HOST") EMAIL_PORT = os.getenv("PLATFORM_SMTP_PORT", 25)

How important is this feature to you?

Not a blocker

Additional context

No response

gilzow commented 4 months ago

PLATFORM_SMTP_HOST is only available if outgoing email has been enabled for the environment.

PLATFORM_SMTP_PORT isn't a Platform.sh/Upsun provided environment variable.

As such, my PR only sets EMAIL_HOST and EMAIL_PORT if the PLATFORM_SMTP_HOST is available. I've also gone ahead and set EMAIL_PORT to a static value of 25.