def run(self): logger.info('starting webapp') logger.info('hosted at %s' % settings.WEBAPP_IP) logger.info('running on port %d' % settings.WEBAPP_PORT) app.run(settings.WEBAPP_IP, settings.WEBAPP_PORT)
def debug(args): port = int(args.port) data_path = utility.abspath(args.json) utility.check_file(data_path) app.config["DATA_PATH"] = data_path app.config["SECRET_KEY"] = "development key" app.run(debug=True, port=port)
def start(): HOST = environ.get('SERVER_HOST', 'localhost') try: PORT = int(environ.get('SERVER_PORT', '5555')) except ValueError: PORT = 5555 app.run(HOST, PORT)
async def _start_web_app(self): while True: await asyncio.sleep(5) if not self.config['no_wifi'] or self.config['MODE'] == 'AP': self.ip = self.config['WIFI'].ifconfig()[0] self.dprint('Run WebAPP...') app.run(debug=self.config['DEBUG'], host=self.ip, port=80)
def run(what): if what == 0: # p = Process(target=keep_twits_updated) keep_twits_updated() elif what == 1: # p = Process(target=keep_cache_updated) keep_cache_updated() elif what == 2: # p = Process(target=app.run, kwargs={'host': "0.0.0.0", 'debug': True}) app.run(host="0.0.0.0", debug=True)
def run(): """Starts local development server""" from webapp import app from werkzeug.serving import run_simple if app.debug: run_simple('0.0.0.0', 5000, app, use_reloader=True, use_debugger=True, use_evalex=True) else: app.run(host='0.0.0.0')
def main(): # Load tasks from file ROOT_DATA.base_task, ROOT_DATA.planned_tasks, ROOT_DATA.last_task_id, ROOT_DATA.running_task_id = load_tasks_from_file( SCHEMA_FILE, DATA_FILE) # start the webapp app.run(debug=True, host="127.0.0.1", port=8000) #app.run(host="0.0.0.0", port=8000) print("saving to file") # Save tasks to file save_to_file(ROOT_DATA.base_task, ROOT_DATA.planned_tasks, DATA_FILE)
def start(args): port = int(args.port) log_path = args.logfilepath lock_path = args.lockfile data_path = utility.abspath(args.json) utility.check_file(data_path) app.config["DATA_PATH"] = data_path app.config["SECRET_KEY"] = "development key" if not op.exists(lock_path): dc = DaemonContext(pidfile=PIDLockFile(lock_path), stderr=open(log_path, "w+"), working_directory=ROOT) with dc: app.run(port=port) else: raise exception.DataProcessorError("Server already stands.")
from webapp import app app.run(host='0.0.0.0', port=4000, debug=False)
""" This script runs the webapp application using a development server. """ from os import environ from webapp import app from config import DEBUG if __name__ == '__main__': HOST = environ.get('SERVER_HOST', 'localhost') try: PORT = int(environ.get('SERVER_PORT', '5000')) except ValueError: PORT = 5000 app.run(HOST, PORT, debug=DEBUG)
from webapp import app, packages if __name__ == '__main__': app.run(debug=True)
from webapp import app app.run(debug=True, host='localhost', port=4000)
from webapp import app if __name__ == '__main__': app.run(host='127.0.0.1', debug=True)
from webapp import app import os """ This is the entrance of our website project. """ if __name__ == '__main__': os.environ['PYTHONHASHSEED'] = '0' """we can set the listening port number and the host ip here.""" app.run(host='0.0.0.0', port=8080)
import configparser from webapp import app app.run(host='0.0.0.0', port=9000, threaded=True, debug=True) #if __name__ == '__main__': # app.run()
if __name__ == '__main__': from options import getOption from webapp import app app.run(host=getOption('flask.host'), debug=getOption('flask.debug'))
# -*- coding: utf-8 -*- from webapp import app if __name__ == '__main__': app.run(host='0.0.0.0', port='8080')
#!venv/bin/python from webapp.config import FLASK_PORT_PROD, FLASK_PORT_DEV, PRODUCTION from webapp import app if __name__ == '__main__': if PRODUCTION: app.run(debug=False, threaded=True, port=FLASK_PORT_PROD) else: app.run(debug=True, port=FLASK_PORT_DEV)
#!/usr/bin/python from webapp import app app.run(host='0.0.0.0', debug=True)
# encoding: utf-8 import os from webapp import app app.run(debug=True, host='0.0.0.0')
#!/usr/bin/env python # # WSGI Main script from webapp import app if __name__ == '__main__': # cmdline version app.run(host='0.0.0.0', port=5000, debug=True)
from webapp import app import os port = os.environ.get('PORT', 5002) try: port = int(port) app.run(debug=True, host='localhost', port=port) except ValueError as e: print('Webapp not started: {}'.format(e))
import zerorpc import argparse from webapp import app parser = argparse.ArgumentParser() parser.add_argument('--port', help='The port that the web app should run on', type=int, default=8080) parser.add_argument( '--password', help='Require the given password in order to access the web app', default='') args = parser.parse_args() client = zerorpc.Client(timeout=3) client.connect('tcp://localhost:44556') app.rpc_client = client app.password = args.password app.run(host='0.0.0.0', port=args.port)
# -*- coding: utf-8 -*- import os import sys sys.path.insert(0, os.path.dirname(__file__)) from webapp import app as application if __name__ == '__main__': application.run()
#!../.virtualenvs/doppler_env/bin/python from webapp import app app.run(host = '0.0.0.0', port = 8080, debug = True)
print APPROOT sys.path.append(APPROOT) from flask import request os.environ['OPENEM_CONFIG'] = 'config.selenium' from webapp import app, db HOST = 'localhost' PORT = 5001 SERVER_URL = 'http://%s:%s/' % (HOST, PORT) from logging import StreamHandler app.logger.addHandler(StreamHandler()) server = threading.Thread(target=lambda: app.run(host=HOST, port=PORT, debug=False)) def start_test_server(): with app.app_context(): db.drop_all() db.create_all() server.start() def shutdown_test_server(): urllib.urlopen(SERVER_URL + 'shutdown') server.join() @app.route('/shutdown') def shutdown_server_handler(): func = request.environ.get('werkzeug.server.shutdown') if func is None:
#!/usr/bin/env python # -*- coding: utf-8 -*- # Run a test server. from webapp import app app.run(host="0.0.0.0", port=8080, debug=True)
from webapp import app from webapp import os, config if 'APP_DEV' in os.environ: app.run(host=config.DevelopmentConfig.HOST) else: app.run()
__author__ = 'ramessne' from webapp import app app.run(host="10.74.44.36",debug=True,port=8080)
def main(): # app.run(debug=True, port=5000, host="0.0.0.0") app.run(debug=True, port=5000)
# -*- encoding: utf-8 -*- # !/usr/bin/python3 # @Time : 2019/7/2 10:20 # @File : manage.py from webapp import app if __name__ == '__main__': app.run(port=5000)
from webapp import app if __name__ == "__main__": app.run(host='0.0.0.0')
import os from webapp import app # Run a test server. app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5001)), debug=True)
elif now: raise ValueError("Running everything now will be a headache!") else: query = query.all() for rec in tqdm(query): if now: process_paper(rec) else: process_paper.queue(rec) return @app.cli.command() @click.argument('paper_ids', nargs=-1) @click.option('--now', is_flag=True) def rerun(): n_queue = 0 for p in paper_ids: if now: rec = Biorxiv.query.filter_by(id=p).first() process_paper(rec) else: n_queue += 1 process_paper.queue(rec) print("Queued {} jobs".format(n_queue)) return if __name__ == "__main__": app.run(debug=True, threaded=True, use_reloader=False)
@app.route('/') def index(): return render_template('index.html') @app.route('/add', methods=['POST']) def add(): form = request.form['input'] add = api.add(form) return str({'string':'string'}) @app.route('/get', methods=['POST']) def get(): retr = api.get() return str(retr) @app.route('/edit', methods=['POST']) def edit(): form = request.form['input'] rval = request.form['replace'] edit = api.edit(form,rval) return str({'string':'string'}) @app.route('/delete', methods=['POST']) def delete(): form = request.form['input'] dele = api.delete(form) return str({'string':'string'}) if __name__ == "__main__": app.run()
from webapp import app import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-p', '--port', dest='port', type=int, action='store', default=4000) args = parser.parse_args() app.run(port=args.port)
from webapp import app if __name__ == "__main__": app.run(debug=True, host='0.0.0.0', port=4000)
#!/usr/bin/env python import os if 'OPENSHIFT_PYTHON_DIR' in os.environ: virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass from webapp import app if __name__ == '__main__': app.run(server='gevent', host=os.environ.get('OPENSHIFT_PYTHON_IP', '127.0.0.1'), port=os.environ.get('OPENSHIFT_PYTHON_PORT', 8080))
#!/usr/bin/env python from webapp import app import os port = int(os.environ.get("PORT", 5000)) app.run(host="0.0.0.0", port=port, debug=False)
from webapp import app from webapp import views app.run(debug=True, host='0.0.0.0', port=5001)
#!/usr/bin/env python # coding: utf-8 import os from webapp import app, db from db_reset import reset_database if bool(int(os.environ['ON_HEROKU'])): @app.before_first_request def setup(): reset_database(db) return if __name__ == '__main__': app.debug = True port = int(os.environ.get('PORT', 5000)) app.run(host='0.0.0.0', port=port)
''' --------------------------- runserver.py --------------------------- Created on 24.04.2015 Last modified on 12.01.2016 Author: Marc Wieland Description: Starts the application using a local flask server (NOT RECOMMENDED: use wsgi implementation instead see README.md) ---- ''' from webapp import app, db, models from flask.ext.login import LoginManager from flask.ext.security import Security,SQLAlchemyUserDatastore #create database stuff db.create_all() #CHANGE THE SECRET KEY HERE: app.secret_key = '42' app.run(debug=True, use_reloader=False)
from webapp import app,routes if __name__ == "__main__": app.run(debug=True, host='0.0.0.0')
from webapp import app, routes if __name__ == "__main__": app.run(debug=True, use_reloader=True, host='0.0.0.0')
#!/usr/bin/env python from webapp import app if __name__ == '__main__': app.run(debug=True)
#!/usr/bin/env python from webapp import app if __name__ == "__main__": app.run(host='0.0.0.0', port=5000)
import os from webapp import app #os.environ["FLASK_DEV_SERVER"] = "true" # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT', 5000)) app.run(debug=True, host='0.0.0.0', port=port)
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # # TX-Pi website. # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software is distributed without any warranty. # You should have received a copy of the CC0 Public Domain Dedication along # with this software. # # If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. # """\ Runs the TX-Pi website locally. """ from webapp import app app.run(debug=True, port=6556)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 13 09:56:18 2018 @author: adam """ from webapp import app app.run(host='0.0.0.0', debug=True)
#!/usr/bin/env python #coding: utf-8 from webapp import app if __name__ == "__main__": app.debug = True app.run("192.168.10.106", 8080)
from configuration.default import Settings from webapp import app if __name__ == '__main__': app.run(host='127.0.0.1', port=8080, debug=True)
## run.py from webapp import app if __name__ == '__main__': app.run(host='0.0.0.0', port=5000)
from webapp import app if __name__ == "__main__": #app.run(host='0.0.0.0',port=80,debug=True) app.run(host='127.0.0.1', port=5001, debug=True)
def run(argc, argv): parser = argparse.ArgumentParser( description='Iposonic is a SubSonic compatible streaming server.' + 'Run with #python ./main.py -c /opt/music') parser.add_argument('-c', dest='collection', metavar=None, type=str, nargs="+", required=True, help='Music collection path') parser.add_argument('-t', dest='tmp_dir', metavar=None, type=str, nargs=None, default=os.path.expanduser('~/.iposonic'), help='Temporary directory, defaults to ~/.iposonic') parser.add_argument('--profile', metavar=None, type=bool, nargs='?', const=True, default=False, help='profile with yappi') parser.add_argument( '--access-file', dest='access_file', action=None, type=str, default=os.path.expanduser('~/.iposonic_auth'), help='Access file for user authentication, defaults to ~/.iposonic_auth. Use --noauth to disable authentication.') parser.add_argument( '--noauth', dest='noauth', action=None, type=bool, nargs='?', const=True, default=False, help='Disable authentication.') parser.add_argument( '--free-coverart', dest='free_coverart', action=None, type=bool, const=True, default=False, nargs='?', help='Do not authenticate requests to getCoverArt. Default is False: iposonic requires authentication for every request.') parser.add_argument('--resetdb', dest='resetdb', action=None, type=bool, const=True, default=False, nargs='?', help='Drop database and cache directories and recreate them.') parser.add_argument( '--rename-non-utf8', dest='rename_non_utf8', action=None, type=bool, const=True, default=False, nargs='?', help='Rename non utf8 files to utf8 guessing encoding. When false, iposonic support only utf8 filenames.') args = parser.parse_args() print(args) if args.profile: yappize() app.config.update(args.__dict__) for x in args.collection: assert(os.path.isdir(x)), "Missing music folder: %s" % x app.iposonic = Iposonic(args.collection, dbhandler=Dbh, recreate_db=args.resetdb, tmp_dir=args.tmp_dir) app.iposonic.db.init_db() # While developing don't enforce authentication # otherwise you can use a credential file # or specify your users inline skip_authentication = args.noauth app.authorizer = Authorizer( mock=skip_authentication, access_file=args.access_file) # # Run cover_art downloading thread # from mediamanager.cover_art import cover_art_worker, cover_art_mock for i in range(1): t = Thread(target=cover_art_worker, args=[app.iposonic.cache_dir]) t.daemon = True t.start() # # Run scrobbling thread # from mediamanager.scrobble import scrobble_worker for i in range(1): t = Thread(target=scrobble_worker, args=[]) t.daemon = True t.start() # # Run walker thread # from scanner import walk_music_folder for i in range(1): t = Thread(target=walk_music_folder, args=[app.iposonic]) t.daemon = True t.start() app.run(host='0.0.0.0', port=5000, debug=False)
from webapp import app if __name__ == '__main__': app.run()
from webapp import app if __name__ == '__main__': app.run(host='localhost', port=5000, debug=True)