#!/usr/bin/env python from flask import Flask from ui import app from ui.controllers import * if __name__ == '__main__': app.run(debug=True, host='0.0.0.0')
from ui import app, cfg if __name__ == '__main__': app.run(debug=cfg.AppConfig['DEBUG_MODE'], host=cfg.AppConfig['HOST'], port=cfg.AppConfig['PORT'])
#!flask/bin/python from ui import app app.run(debug=True, host='0.0.0.0', port=99)
import sys sys.dont_write_bytecode = True import os from ui import app import sys from OpenSSL import SSL context = SSL.Context(SSL.SSLv23_METHOD) #context.use_privatekey_file('/srv/stunnel.key') #context.use_certificate_file('/srv/stunnel.cert') if __name__ == '__main__': port = int(os.environ.get("PORT", 5050)) # app.run(host='0.0.0.0', port=port, ssl_context=context) app.run(host='0.0.0.0', port=port)
import os # noqa: F401 import sys # noqa: F401 from ui import app # noqa E402 import ui.routes # noqa E402 if __name__ == '__main__': app.run(debug=True)
'SECURITY_PASSWORD_SALT'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' app.config['SECURITY_MSG_INVALID_PASSWORD'] = ( 'Your username and password do not match our records', 'error') security = Security(app, user_datastore) # Create a role to test with @app.before_first_request def set_up(): try: user_datastore.create_role(name='admin', description='Site administrator') encrypted_password = utils.encrypt_password('changeme!') user_datastore.create_user(email='*****@*****.**', password=encrypted_password, roles=["admin"], active=True) logging.info("roles and user were added") except Exception, e: print str(e) logging.info("already set up") logging.info('instance : ' + app_instance + ' up & running.') if app.config['DEBUG']: app.debug = False logging.info("About to start!") app.run('0.0.0.0', port=5081, threaded=True)
#!/usr/bin/python import sys from ui import app if __name__ == '__main__': host = "127.0.0.1" port = 8080 bDebug = True if len(sys.argv) > 1: host = str(sys.argv[1]) bDebug = False if len(sys.argv) > 2: port = int(sys.argv[2]) if len(sys.argv) > 3: if int(sys.argv[3]): bDebug = True app.run(host=host, port=port, debug=bDebug, use_reloader=bDebug, threaded=True)
from ui import app import logging from logging import FileHandler # file_handler = FileHandler(os.path.join(cache_dir, 'web.log')) # file_handler.setLevel(logging.WARNING) # app.logger.addHandler(file_handler) app.run(host="0.0.0.0", port=8080, debug=True)
import os # noqa: F401 import sys # noqa: F401 from ui import app # noqa E402 import ui.routes # noqa E402 if __name__ == '__main__': app.run(host="127.0.0.1", port="9999", debug=True)
#!/usr/bin/python import sys import argparse from ui import app if __name__ == '__main__': parser = argparse.ArgumentParser(description='Minezy API Server') parser.add_argument("-host", default="127.0.0.1") parser.add_argument("-port", default=8080, type=int) parser.add_argument("-debug", action='store_true') args = parser.parse_args() app.run(host=args.host, port=args.port, debug=args.debug, use_reloader=args.debug, threaded=True)
parser.add_argument('-p', '--port', help="Server port") parser.add_argument('-c', '--cache', help="Generated file cache. ") parser.add_argument('-P','--use-proxy',action='store_true', help="Setup for using a proxy in front of server, using werkzeug.contrib.fixers.ProxyFix") parser.add_argument('-d','--debug',action='store_true',help="Set debugging mode") parser.add_argument('-C','--check-config',action='store_true',help="print cache string and configuration file and exit") parser.add_argument('-t','--test',action='store_true',help="Run a test function in development") args = parser.parse_args() app_config = {'host': '0.0.0.0', 'port': 8080, 'debug': False} for k, v in vars(args).items(): if v: app_config[k] = v if args.use_proxy: from werkzeug.contrib.fixers import ProxyFix app.wsgi_app = ProxyFix(app.wsgi_app) import ui.views app.run(host=app_config['host'], port=int(app_config['port']), debug=app_config['debug'])