123456789101112131415161718192021 |
- # -*- coding: utf-8 -*-
- """
- demeter web
- name:site.py
- author:rabin
- """
- import datetime
- t = datetime.datetime(2017,12,21)
- if type(t) == datetime.datetime:
- print 1
- print 2
- """
- from demeter.core import *
- from celery import Celery,platforms
- platforms.C_FORCE_ROOT = True
- app = Celery('task', backend='redis://0.0.0.0:6379/0', broker='redis://0.0.0.0:6379/0') #配置好celery的backend和broker
-
- @app.task #普通函数装饰为 celery task
- def add(x, y):
- return x + y
- """
|