No connection could be made because the target machine actively refused it (Django)

前端 未结 7 795
小鲜肉
小鲜肉 2021-02-07 12:14

I have followed the Django Book up until chapter seven, and I am currently messing around with forms, GET, POST and all that goodness. At one point, the guide made me figure out

7条回答
  •  悲哀的现实
    2021-02-07 12:56

    I got this error attempting to use django.core.mail.send_mail. I only need this for running through some tutorials. I don't need it to actually send mail.

    The solution for me was to add this single variable to settings.py:

    EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
    

    It sends the content of the email to console output, which is perfect given what I'm doing.

    Docs: https://docs.djangoproject.com/en/1.7/topics/email/#django.core.mail.backends.smtp.EmailBackend

提交回复
热议问题