Avatar ·

django. sending email on localhost

📁 Advanced Python Topics, Error, example, AI, debug, work

Tell me how I can send an email to a mailbox on a local server. Django runs on localhost:8080, and for sending (as I read in the documentation) an SMTP server is needed. I also start a local one

python -m smtpd -n -c DebuggingServer localhost:1025

I get localhost:1025 in the view

send_mail('theme', 'my messege', 'admins@studio.ru',['a@a.ru'])

I caught various errors, for example with getaddrinfo(host, port) I added to the view

import socketsocket.getaddrinfo('