Skip to content

Instantly share code, notes, and snippets.

@exit99
Created January 8, 2016 20:21
Show Gist options
  • Save exit99/4dce26d0d631c7d00549 to your computer and use it in GitHub Desktop.
Save exit99/4dce26d0d631c7d00549 to your computer and use it in GitHub Desktop.
from core.extensions import celery
app = Flask(__name__)
celery.init_app(app)
app.run()
class CeleryHelper():
def init_app(self, app):
# Do stuff
self.celery = celery
def __getattr__(self, name):
return getattr(self.celery, name)
celery = CeleryHelper()
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