# -*- coding: utf-8 -*- from application.application import create_app application = create_app('app.cfg') if __name__ == '__main__': application.run(host='0.0.0.0', port=3000, debug=application.config.get('DEBUG'))
def create_app(): return application.create_app()
def test_application_constructor(): uut = create_app() assert uut is not None
from application.application import create_app, start_dev_server DEBUG = True app = create_app() if __name__ == '__main__' and __package__ is None: if DEBUG: start_dev_server(app) else: app.run()
#/usr/bin/env python # -*- coding: utf-8 -*- import os import sys app_path = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + '/../') sys.path.append(app_path) from application.application import create_app app = create_app('app.cfg', cronapp=True) with app.app_context(): import application.model as model data = model.auction_close_finished() if not data: sys.exit() mails = [] for x in data: mail = model.mail_create( message='Auction closed: %s' % x['auction_id'], subject='Auction closed', sender=app.config.get('MAIL_USERNAME'), recipients=[x['email']] ) mails.append(mail) model.mail_send(mails)