def main(): logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] [%(levelname)s] %(message)s') Archive.reload() RescrapeTask().start() app.run(host='0.0.0.0')
def main(): app.run()
def main(): app.debug = True app.run(host=app.config['BIND'], port=app.config['PORT'])
from controller import app if __name__ == "__main__": app.run(host="127.0.0.1", port="5000", debug=True)
def init(): config_file = os.path.join( os.path.abspath( os.path.dirname(__file__)), 'config.cfg') app.config.from_pyfile(config_file, silent=True) db.create_all() try: user = User.query.filter( User.name == 'admin').one() except: user = User(name='admin', password='******') db.session.add(user) db.session.commit() try: role = Role.query.filter( Role.name == 'admin').one() except: role = Role(name='admin') db.session.add(role) db.session.commit() if not user.has_role('admin'): user.roles.append(role) db.session.commit() if __name__ == '__main__': init() app.run()
#!/usr/bin/env python from controller import app from model import createDB import config import sys reload(sys) sys.setdefaultencoding('utf-8') if __name__ == '__main__': # Create database if needed createDB(); # Run the application app.run(config.app.webserver.host, config.app.webserver.port, debug=True)
from controller import app app.run(port=3000, debug=True, ssl_context="adhoc")
from controller import app app.run(port=5000)
from controller import app if __name__ == '__main__': app.run(debug=True, host='127.0.0.1', port=8000)
] trace1 = go.Scatter(x=risks_df.index, y=risks_df['volatility'], mode='lines', text=component_contribution_list, hoverinfo="x+y+text") figure = { 'data': [trace1], 'layout': { 'title': 'Portfolio Volatility Risk' } } risk_graph = [dcc.Graph(id='risk_graph', figure=figure)] return risk_graph else: return html.H3('Error: Select an option for Choose field', style={ 'text-align': 'center', 'color': 'red' }) @server.route('/dashboard') def render_dashboard(): return flask.redirect('/dash') if __name__ == '__main__': # app.run_server(debug=True) server.run()
#!/usr/bin/python3 from controller import app if __name__ == "__main__": from os import chdir print('Schema Controller - main') # Change the base dir to where this __file__ is located # Needed for testing # FILE_NAME = 'wsgi.py' FILE_NAME = __file__[__file__.rindex("/") + 1:] if __file__ != FILE_NAME: BASE_DIR = __file__[:__file__.index(FILE_NAME)] chdir(BASE_DIR) try: # This will setup the server and start the serve_forever() loop # This will block the script until the serve_forever() loop is interrupted app.run(cloud=True) except KeyboardInterrupt: # Silence KeyboardInterrupt exception pass except Exception as e: print(e) exit(-1)
# -*- coding: utf-8 -*- from controller import app from controller import * import sys reload(sys) sys.setdefaultencoding("utf-8") app.debug = True app.run(host='127.0.0.1', port=5000)
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Main script for running Heso on Heroku.""" import os from setting import REPO_ROOT from controller import app, make_app from application import get_all_heso, destroy_heso REMAINED = 8 @app.route('/clean') def clean(): for i, heso in enumerate(get_all_heso()): if REMAINED <= i: destroy_heso(heso['reponame']) return "Cleaning has been completed" if __name__ == '__main__': if not os.path.exists(REPO_ROOT): os.mkdir(REPO_ROOT) app = make_app() app.run(host='0.0.0.0', port=int(os.environ.get("PORT", 5000)))
#!/usr/bin/python3 from wsgiref import simple_server from controller import app if __name__ == "__main__": from os import chdir print('Schema Controller - main') # Change the base dir to where this __file__ is located # Needed for testing FILE_NAME = 'wsgi.py' if __file__ != FILE_NAME: BASE_DIR = __file__[:__file__.index(FILE_NAME)] chdir(BASE_DIR) try: # This will setup the server and start the serve_forever() loop # This will block the script until the serve_forever() loop is interrupted app.run(cloud=True) except KeyboardInterrupt: # Silence KeyboardInterrupt exception pass except Exception as e: print(e) exit(-1)
from controller import app if __name__ == '__main__': app.run(); app.run(debug=True);
#!/usr/bin/env python #-*-coding:UTF-8-*- from controller import app if __name__ == "__main__": app.run(host='0.0.0.0', port=8000,debug=True,reloader=True) else: #os.chdir(os.path.dirname(__file__)) application = app
from controller import app # THE GBC API Hosted On Port 8082 if __name__ == '__main__': app.run(debug=True, port=8082,host='0.0.0.0')
import sys from controller import app if __name__ == '__main__': app.run(sys.argv[1:])
def run(): """ run server on port 8000 and domain name is ... """ app.run(host='0.0.0.0', port=8000, debug=True)
def thread_web(): app.run()
from controller import app import os import logging if not app.debug and os.environ.get('HEROKU') is None: from logging.handlers import RotatingFileHandler file_handler = RotatingFileHandler('pgtc.log', 'a', 1 * 1024 * 1024, 10) file_handler.setLevel(logging.INFO) file_handler.setFormatter( logging.Formatter( '%(asctime)s %(levelname)s: %(message)s ' '[in %(pathname)s:%(lineno)d]')) app.logger.addHandler(file_handler) app.logger.setLevel(logging.INFO) app.logger.info('Pokemon Go Trainer Card startup') if os.environ.get('HEROKU') is not None: stream_handler = logging.StreamHandler() app.logger.addHandler(stream_handler) app.logger.setLevel(logging.INFO) app.logger.info('Pokemon Go Trainer Card startup') if __name__ == '__main__': app.run(port=8000, debug=False)
# coding=utf-8 from controller import app app.run(debug=True, port=8888)
from controller import app import logging from logging.handlers import RotatingFileHandler #from webzeug.debug import DebuggedApplication if __name__ == "__main__": handler = RotatingFileHandler('foo.log', maxBytes=10000, backupCount=1) handler.setLevel(logging.ERROR) app.logger.addHandler(handler) # app.wsgi_app = DebuggedApplication(app.wsgi_app, True) app.run(debug=True, host='0.0.0.0', port=3000)
# Copyright 2018 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Create an IBackend instance""" from flask import helpers from common import auth_filter import flask_tasks from controller import app, config, extensions CONFIG = config.DevConfig if helpers.get_debug_flag() else config.ProdConfig app = app.create_app(extensions.api, config_object=CONFIG) flask_tasks.add(app) auth_filter.add(app) if __name__ == '__main__': app.run(host='0.0.0.0', port=8080, debug=True)
""" Description: Script for starting the flask application. Usage: $ python ECosmetics.py """ from controller import app if __name__ == '__main__': app.run(debug=True)
# coding:utf8 from controller import app __author__ = 'Tavern' app.run('0.0.0.0', 3000)
from controller import app import controller import threading p = threading.Thread(target=controller.monitor) p.daemon = True p.start() app.run()
repair_project_dict = dict() repair_project_dict['repair_order_id'] = request.args.get('repair_order_id') \ if request.args.get('repair_order_id') is not None else -1 return render_template('repair_project.html', repair_project_dict=repair_project_dict) @app.route('/material') def material(): material_dict = dict() material_dict['material_id'] = request.args.get('material_id') if request.args.get('material_id') is not None \ else -1 return render_template('material.html', material_dict=material_dict) @app.route('/carOwner') def car_owner(): car_owner_dict = dict() car_owner_dict['car_owner_id'] = request.args.get('car_owner_id') if request.args.get('car_owner_id') is not None \ else -1 return render_template('car_owner.html', car_owner_dict=car_owner_dict) @app.route('/') def index(): return render_template('index.html') if __name__ == '__main__': app.run(debug=True, threaded=True)
from controller import app import os port = int(os.getenv('PORT', 8000)) if __name__ == '__main__': app.run(host='0.0.0.0', port=port, debug=True)
from controller import app if __name__ == '__main__': app.run(host='0.0.0.0')