Created
January 8, 2016 20:21
-
-
Save exit99/4dce26d0d631c7d00549 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from core.extensions import celery | |
app = Flask(__name__) | |
celery.init_app(app) | |
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CeleryHelper(): | |
def init_app(self, app): | |
# Do stuff | |
self.celery = celery | |
def __getattr__(self, name): | |
return getattr(self.celery, name) | |
celery = CeleryHelper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from core.extension import celery | |
@celery.task | |
def stuff(): | |
# do stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment