docker中的django&send_mail导致SMTPServerDisconnected

我设置了一个谷歌电子邮件后端Django和所有工作正常,直到我在码头组成容器中运行的整个东西。

SMTPServerDisconnected at /events/register/4/ please run connect() first Request Method: GET Request URL: http://192.168.99.100:80/events/register/4/ Django Version: 1.11.3 Exception Type: SMTPServerDisconnected Exception Value: please run connect() first Exception Location: /usr/local/lib/python3.6/smtplib.py in send, line 359 Python Executable: /usr/local/bin/uwsgi Python Version: 3.6.2 Python Path: ['.', '', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages', '/app'] Server time: Tue, 25 Jul 2017 11:07:45 +0200 

任何想法这里怎么了? 为什么它在容器中断开?

只是想通了:在docker-compose.yml我有这样的东西:

 env_file: - ".env" 

.env的内容是:

 key = value 

这在本地机器上运行很好,首先加载.env文件。 不过,码头需要更严格的格式:

 key=value 

没有空间!!

错误是我的EMAIL_ *设置没有使用间隔键/值对正确设置

Interesting Posts