Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ services:
test: ["CMD", "redis-cli","ping"]
interval: 1s

mailpit:
image: axllent/mailpit:v1.27
ports:
- "8025:8025"

web:
build:
context: .
Expand All @@ -33,11 +38,16 @@ services:
environment:
DATABASE_URL: postgresql://pythondotorg:pythondotorg@postgres:5432/pythondotorg
DJANGO_SETTINGS_MODULE: pydotorg.settings.local
EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST: mailpit
EMAIL_PORT: 1025
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_started

worker:
image: pythondotorg:docker-compose
Expand All @@ -47,8 +57,13 @@ services:
environment:
DATABASE_URL: postgresql://pythondotorg:pythondotorg@postgres:5432/pythondotorg
DJANGO_SETTINGS_MODULE: pydotorg.settings.local
EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST: mailpit
EMAIL_PORT: 1025
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_started
2 changes: 2 additions & 0 deletions docs/source/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ web_1 | Quit the server with CONTROL-C.

You can view these results in your local web browser at: <http://localhost:8000>

Emails sent by the site (account verification, nomination confirmations, etc.) are caught by [Mailpit](https://mailpit.axllent.org/) and can be read at <http://localhost:8025>.

To reset your local environment, run:

```
Expand Down
5 changes: 4 additions & 1 deletion pydotorg/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
},
}

EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
# docker-compose points these at Mailpit; outside Docker, mail prints to the console.
EMAIL_BACKEND = config("EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend")
EMAIL_HOST = config("EMAIL_HOST", default="localhost")
EMAIL_PORT = config("EMAIL_PORT", default=25, cast=int)


try:
Expand Down
Loading