def testserver(open_server, debug_js): from anyway import app logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s') if debug_js: app.config['ASSETS_DEBUG'] = True default_host = '0.0.0.0' if open_server else '127.0.0.1' app.run(debug=True, host=os.getenv('IP', default_host), port=int(os.getenv('PORT', 5000)))
def testserver(open_server, debug_js): from anyway import app logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s', level=logging.DEBUG, datefmt='%Y-%m-%d %H:%M:%S') if debug_js: app.config["ASSETS_DEBUG"] = True default_host = "0.0.0.0" if open_server else "127.0.0.1" app.run(debug=True, host=os.getenv("IP", default_host), port=int(os.getenv("PORT", 5000)))
def testserver(open_server, debug_js): from anyway import app from anyway.parsers import united from apscheduler.scheduler import Scheduler sched = Scheduler() @sched.interval_schedule(hours=12) def scheduled_import(): # pylint: disable=unused-variable united.main() sched.start() logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s') if debug_js: app.config['ASSETS_DEBUG'] = True default_host = '0.0.0.0' if open_server else '127.0.0.1' app.run(debug=True, host=os.getenv('IP', default_host), port=int(os.getenv('PORT', 5000)))
from anyway import app if __name__ == '__main__': app.run(debug=True)