예제 #1
0
    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)
예제 #2
0
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)
예제 #3
0
def start():
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)
예제 #4
0
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)
예제 #5
0
 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)
예제 #6
0
    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)
예제 #7
0
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)
예제 #8
0
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')
예제 #9
0
파일: Main.py 프로젝트: v-chanikya/planner
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)
예제 #10
0
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.")
예제 #11
0
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.")
예제 #12
0
from webapp import app
app.run(host='0.0.0.0', port=4000, debug=False)
예제 #13
0
"""
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)
예제 #14
0
from webapp import app, packages

if __name__ == '__main__':
    app.run(debug=True)
예제 #15
0
from webapp import app
app.run(debug=True, host='localhost', port=4000)
예제 #16
0
파일: run.py 프로젝트: rashaev/dcs
from webapp import app

if __name__ == '__main__':
    app.run(host='127.0.0.1', debug=True)
예제 #17
0
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)
예제 #18
0
import configparser

from webapp import app

app.run(host='0.0.0.0', port=9000, threaded=True, debug=True)
#if __name__ == '__main__':
#	app.run()
예제 #19
0
if __name__ == '__main__':
    from options import getOption
    from webapp import app
    app.run(host=getOption('flask.host'), debug=getOption('flask.debug'))
예제 #20
0
파일: run.py 프로젝트: x2h/uberbrew
# -*- coding: utf-8 -*-
from webapp import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port='8080')
예제 #21
0
#!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)
예제 #22
0
#!/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')
예제 #24
0
파일: app.py 프로젝트: jorgbosman/website
#!/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)

예제 #25
0
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))
예제 #26
0
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)
예제 #27
0
파일: wsgi.py 프로젝트: Se7ge/THIF-API
# -*- 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()
예제 #28
0
#!../.virtualenvs/doppler_env/bin/python
from webapp import app
app.run(host = '0.0.0.0', port = 8080, debug = True)
예제 #29
0
파일: app.py 프로젝트: openemotion/webapp
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:
예제 #30
0
#!/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)
예제 #31
0
from webapp import app
from webapp import os, config

if 'APP_DEV' in os.environ:
    app.run(host=config.DevelopmentConfig.HOST)
else:
    app.run()
예제 #32
0
파일: run.py 프로젝트: rmessner/ansible-web
__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)
예제 #34
0
# -*- 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)
예제 #35
0
from webapp import app

if __name__ == "__main__":
    app.run(host='0.0.0.0')
예제 #36
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)
예제 #37
0
    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)
예제 #38
0
파일: wsgi.py 프로젝트: ivandevera/webapp
@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()
예제 #39
0
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)
예제 #40
0
from webapp import app

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0', port=4000)
예제 #41
0
파일: app.py 프로젝트: larsks/remarkable
#!/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))

예제 #42
0
#!/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)

예제 #43
0
from webapp import app
from webapp import views

app.run(debug=True, host='0.0.0.0', port=5001)
예제 #44
0
#!/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)
예제 #46
0
from webapp import app,routes

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0')
예제 #47
0
파일: app.py 프로젝트: aa-ag/venmolikeapi
from webapp import app, routes

if __name__ == "__main__":
    app.run(debug=True, use_reloader=True, host='0.0.0.0')
예제 #48
0
파일: app.py 프로젝트: jncornett/accounting
#!/usr/bin/env python

from webapp import app

if __name__ == '__main__':
    app.run(debug=True)
예제 #49
0
#!/usr/bin/env python
from webapp import app

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5000)
예제 #50
0
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)
예제 #51
0
#! /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)
예제 #52
0
#!/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)
예제 #53
0
#!/usr/bin/env python
#coding: utf-8

from webapp import app

if __name__ == "__main__":
    app.debug = True
    app.run("192.168.10.106", 8080)
예제 #54
0
from configuration.default import Settings
from webapp import app

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=8080, debug=True)
예제 #55
0
## run.py
from webapp import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)
예제 #56
0
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)
예제 #57
0
파일: main.py 프로젝트: SimonHova/iposonic
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)
예제 #58
0
from webapp import app

if __name__ == '__main__':
    app.run()
예제 #59
0
from webapp import app

if __name__ == '__main__':
    app.run(host='localhost', port=5000, debug=True)