繁体   English   中英

如何在不使用 django 在 python 中使用 celery 发送电子邮件

[英]How to send email with celery without using django in python

我有一个 email.py 没关系,不用 celery 也可以。 我想让它和芹菜一起排队。

在没有 django 的情况下,我找不到在 python 中使用 celery 的单个教程。

我已经检查了https://readthedocs.org/projects/celery/但它是如此令人困惑

from celery import Celery

app = Celery('hello', broker='amqp://guest@localhost//')

@app.task
def send_email():
    #write your code here

就是这么简单。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM