示例#1
0
 def __call__(self, *args, **kwargs):
     with app.app_context():
         return TaskBase.__call__(self, *args, **kwargs)
示例#2
0
文件: task.py 项目: ewfrer/pjbbs
def sendemail(recvemail, r):
    with app.app_context():
        msg = Message("邮箱验证码", recipients=[recvemail], body="验证码为" + r)
        mail.send(msg)
示例#3
0
 def decorated_function(*args, **kwargs):
     with app.app_context():
         g.mongo = app_mongo
         g.redis = app_redis
         return function(*args, **kwargs)
示例#4
0
def setmail(data, r):
    with app.app_context():
        msg = Message("我的邮箱验证码", recipients=[data], body="验证码为" + r)
        mail.send(msg)
示例#5
0
def setphone(data, rs):
    with app.app_context():
        r = send_sms(phone_numbers=data, smscode=rs)
from celery_app import celery, app
from model.db import db

db.init_app(app)

if __name__ == '__main__':
    with app.app_context():
        celery.start()