def main(argv): args = docopt(__doc__, argv=argv[1:]) if args['www']: app = create_instance() app.run(debug=args['--debug'], port=int(args['--port']), host=args['--host']) if args['bots']: start_manager() elif args['init']: app = create_instance() with app.app_context(): # Let SQLAlchemy create any missing tables. db.create_all()
def main(argv): args = docopt(__doc__, argv=argv[1:]) if args['www']: app = create_instance() app.run( debug=args['--debug'], port=int(args['--port']), host=args['--host'] ) elif args['init']: app = create_instance() with app.app_context(): # Let SQLAlchemy create any missing tables. db.create_all()
def main(argv): args = docopt(__doc__, argv=argv[1:]) if args['www']: app = create_instance() app.run( debug=args['--debug'], port=int(args['--port']), host=args['--host'] )
def send_mail(*args, **kwargs): """ Sends an email using Flask-Mail and Notifico's configuration settings. """ # TODO: Allow bulk sending using flask.mail.Connection. celery_app = create_instance() with celery_app.app_context(): m = Message(*args, **kwargs) mail.send(m)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utility kludge to start celery within a Flask application context, so we can use Flask's configuration for everything. """ from notifico import create_instance, celery if __name__ == '__main__': app = create_instance() with app.app_context(): celery.start()