这听起来可能是一个非常愚蠢的问题,但我已经使用 Linux 一年多了,我仍然像 Windows 一样使用它。我完全不知道如何更多地了解bash或其他 Linux 内部。任何人都可以帮助我吗?指导我如何继续更多地了解 Linux 并体验他们所说的全部力量。
我正在尝试从我的 django 应用程序发送电子邮件。
但是,这不适用于我的 NGINX(用于静态资源)+ GUNICORN 服务器。
但是,同样适用于 django 的默认网络服务器。到目前为止,我还没有设置邮件服务器本身。
我不确定问题是什么。
让我解释整个情况,因为这个问题没有得到很好的解释。
如果我使用默认调试 WSGI 从 Django 中的 Web 应用程序发送电子邮件,
和以下代码
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com',
['to@example.com'], fail_silently=False)
Run Code Online (Sandbox Code Playgroud)
我可以发送电子邮件。
但是,我已经设置了一个 nginx 服务器和一个 gunicorn wsgi。我无法发送邮件。
我的 nginx.conf 看起来像这样
server {
listen 80;
listen 443;
listen 587;
server_name 172.17.110.205;
client_max_body_size 0M;
access_log /home/msrb_db/msrb_db_application/access.log;
error_log /home/msrb_db/msrb_db_application/error.log;
location /static {
root /home/msrb_db/msrb_db_application;
}
location / {
proxy_pass http://172.17.110.205:8080;
}
}
Run Code Online (Sandbox Code Playgroud)
我有一个 gunicorn 服务器作为系统文件,其工作方式如下
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=msrb_db …Run Code Online (Sandbox Code Playgroud)