Ejemplo n.º 1
0
def runTheServer():
    print()
    print("GO TO ", thisPCIP, ':', thisPCPORT, ' to share files')
    print()
    try:
        flask_app.run(host=thisPCIP, port=thisPCPORT, debug=ISDEBUG)
    except OSError:
        print("\n\n Please connect your PC to a network\n\n")
Ejemplo n.º 2
0
def public_server():
    """ Launch public server

        Note: Do not use in production
        See http://flask.pocoo.org/docs/0.11/deploying/#deployment

    """
    # IMPORTANT: DEBUG MUST NEVER BE TRUE ON EXTERNALLY VISIBLE SERVERS!
    flask_app.run(host='0.0.0.0', port=80, threaded=True, debug=False)
    sys.exit(1)
Ejemplo n.º 3
0
from flask import Flask
from app import flask_app

app = flask_app

if __name__ == '__main__':
    flask_app.debug = True
    flask_app.run(host='0.0.0.0')
Ejemplo n.º 4
0
#!/usr/bin/env python

"""
Main application script.
"""

from app import flask_app
import os

if __name__ == "__main__":
    flask_app.run(host = "0.0.0.0", port = int(os.getenv("PORT", 5000)))
Ejemplo n.º 5
0
# Copyright 2017 Richard Campen
# All rights reserved
# This software is released under the Modified BSD license
# See LICENSE.txt for the full license documentation

from app import flask_app

if __name__ == '__main__':
    flask_app.run(debug=True, port=5001)
Ejemplo n.º 6
0
from app import flask_app, db

if __name__ == '__main__':
    flask_app.run()
Ejemplo n.º 7
0
from app import flask_app

# flask_app.debug = True
# flask_app.run(port = 8081, host='localhost')

flask_app.debug = False
flask_app.run(port = 8081, host = '0.0.0.0')
Ejemplo n.º 8
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from app import flask_app


def get_connection_info():
    host = '0.0.0.0'
    port = 5000
    return host, port


if __name__ == '__main__':
    flask_app.secret_key = '\xbc\xcc+\x90\x8f\x15]\xd4\xbc\x05\xdaQs\xbf\xce\x1eT\xc79\x04\x14g}\xe2'
    flask_app.debug = True
    host, port = get_connection_info()
    flask_app.run(host, port)




Ejemplo n.º 9
0
import os
from os.path import join, dirname

from dotenv import load_dotenv
from app import flask_app

if __name__ == '__main__':
    # Load environment variables from file
    dotenv_path = join(dirname(__file__), '.env')
    load_dotenv(dotenv_path)

    # Run WSGI application
    flask_app.run(host=os.environ['HOST'],
                  port=os.environ['PORT'],
                  debug=os.environ.get('DEBUG', False))
Ejemplo n.º 10
0
def main():
    # threaded = True  для организации доступа к серверу нескольких клиентов
    temp_dir = os.path.join(default.PROJECT_DIR, 'app', 'temp_files')
    if not os.path.exists(temp_dir):
        os.makedirs(temp_dir)
    flask_app.run(host='0.0.0.0', threaded=True)
Ejemplo n.º 11
0
from app import flask_app

if __name__ == "__main__":
    debug = False
    host = "0.0.0.0"
    flask_app.run(host, port=5000, debug=debug)
Ejemplo n.º 12
0
from app import flask_app
from api import performance

if __name__ == '__main__':
    flask_app.run(host="0.0.0.0", debug=1)
Ejemplo n.º 13
0
from app import flask_app

# this is used in production by:
#   gunicorn -b 127.0.0.1:5000 run:flask_app

if __name__ == '__main__':
  flask_app.run()
Ejemplo n.º 14
0
from app import flask_app


flask_app.run(debug=flask_app.config['DEBUG'],
              host='0.0.0.0',
              port=flask_app.config['PORT'])
Ejemplo n.º 15
0
def local_server():
    """ Launch local server """
    flask_app.run(host="127.0.0.1", port=5000, threaded=True, debug=True)
    sys.exit(1)
Ejemplo n.º 16
0
from app import flask_app

if __name__ == '__main__':
    flask_app.run(host="0.0.0.0", debug=True)
Ejemplo n.º 17
0
from app import flask_app

if __name__ == '__main__':
    flask_app.run('0.0.0.0', debug=True)
def run_project():
    flask_app.run(debug=True)
Ejemplo n.º 19
0
from app.auth.views import auth_bp
from app.widgets.views import widg_bp

import config

sys.path.append(os.path.join(config.basedir,"app"))


@flask_app.route('/')
def index():
    return render_template('index.html')


def app_setup(app):
    flask_app.config.from_object('config')
    flask_app.secret_key  = config.SECRET_KEY
    # all models have to be loaded at this point
    flask_app.register_blueprint(auth_bp)
    flask_app.register_blueprint(widg_bp)
    #with flask_app.app_context():
    #    from app.widgets.models import Widget        
    #    from app.auth.models import User    
    #    
    #    db.create_all()



if __name__ == '__main__':
    app_setup(flask_app)    
    flask_app.run(debug=True)
Ejemplo n.º 20
0
import os 
from app import flask_app

if __name__ == '__main__':
    flask_app.run(
        host=os.environ.get('HOST', '127.0.0.1'),
        port=os.environ.get('PORT', 5000),
        debug=os.environ.get('DEBUG', False)
    )
Ejemplo n.º 21
0
# This is only for development.
#
# In production, Flask is run by mod_wsgi, which imports the via wsgi.py.

from app import flask_app as app

app.debug = True
app.run(port=8080, host='0.0.0.0')
Ejemplo n.º 22
0
from app import flask_app

if __name__ == "__main__":
    flask_app.run(debug=True, host="0.0.0.0")
Ejemplo n.º 23
0
def start():
    flask_app.run()
Ejemplo n.º 24
0
from app import flask_app as app

if __name__ == "__main__":
    app.run()
Ejemplo n.º 25
0
from app import flask_app

if __name__ == '__main__':
    flask_app.run(threaded=True)
Ejemplo n.º 26
0
def local_server():
    """ Launch local server """
    flask_app.config.from_object(config.BaseConfig)
    flask_app.run(host="127.0.0.1", port=5000, threaded=True, debug=True)
    sys.exit(1)
Ejemplo n.º 27
0
from app import flask_app
from app import routes
from app import config
from app import models
from app import schemas

if __name__ == '__main__':
    flask_app.run(port=3000, debug=True, host="0.0.0.0")
Ejemplo n.º 28
0
def start_listening():
    logger.info('Start listening for slacks events')
    flask_app.run(port=3000)
Ejemplo n.º 29
0
def start():
    debug = True
    host = "0.0.0.0"
    flask_app.run(host, debug=debug)
Ejemplo n.º 30
0
from app import flask_app

if __name__ == '__main__':
    flask_app.run(host=flask_app.config.get('HOST'),
                  port=flask_app.config.get('PORT'))
Ejemplo n.º 31
0
from app import flask_app as app

if __name__ == "__main__":
    app.run("0.0.0.0", port=8001, debug=True)
Ejemplo n.º 32
0
def run():
    flask_app.run(db, debug=True)
Ejemplo n.º 33
0
from app import flask_app as application
import os

# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
if __name__ == '__main__':
    application.run(debug=False, host='0.0.0.0', port=7778)

Ejemplo n.º 34
0
#!/usr/bin/env python3
from app import flask_app

if __name__ == '__main__':
    flask_app.run(host='127.0.0.1', debug=False)
Ejemplo n.º 35
0
from app import flask_app

if __name__ == '__main__':
    flask_app.run(host='0.0.0.0', port=5000, debug=True)
Ejemplo n.º 36
0
    redis_ready = True
except redis.exceptions.ConnectionError as e:
    redis_ready = False
    print("redis failed to ping!")
    print(e)


@flask_app.route('/')
def hello():
    # Simply expose the base route
    msg = "Hello Flask!"
    return jsonify(msg)


@flask_app.route('/expose_redis/')
def expose_redis():
    """Demonstrates that the celery and redis behavior can be bound
    to REST endpoint(s), e.g. for health checks."""
    msg = p.get_message()
    if isinstance(msg, dict):
        return jsonify(json.loads(
            # The data came in with illegal single quotes on the keys.
            msg['data'].decode('utf8').replace("'", '"')))
    else:
        return jsonify("No messages left in the queue...")


if __name__ == "__main__":
    # Replace with gunicorn for prod, I guess
    flask_app.run('0.0.0.0', 8000, debug=True)
Ejemplo n.º 37
0

# Libraries
import argparse
import os
from app import flask_app, logger

# Get command line arguments
parser = argparse.ArgumentParser(description='Command line options.')
parser.add_argument('--port', type=int, default=8080)
parser.add_argument('--debug', 
                    dest='debug',
                    action='store_true',
                    help='debug version of server')
parser.add_argument('--prod', 
                    dest='debug',
                    action='store_false',
                    help='production version of server')
parser.set_defaults(debug=False)
args = parser.parse_args()

# Setup project
script_name = os.path.basename(__file__).split('.')[0]


# Main loop
if __name__ == "__main__":
    logger.debug('Starting server...')
    logger.debug('Server port: %d' % (args.port))
    flask_app.run(host='0.0.0.0', port=args.port, debug=args.debug)
Ejemplo n.º 38
0
from app import flask_app
from app.registerblueprint import registerBluePrint

registerBluePrint(flask_app)
flask_app.run(debug=True)
"""Running this file starts the Flask server"""

from os import walk, path, environ
from app import flask_app

__author__ = "Jeffrey Chan"

"""This goes through all the files in client and adds them a list called
extra_files. Passed into the run function, the server knows to watch all
the files in the client folder for changes and restart the server after
detecting a change. This is extremely useful when developing the app, but
should not be done on the production server where files should never change.
"""
if "HEROKU" not in environ:
    extra_dirs = ['app/client']
    extra_files = extra_dirs[:]
    for extra_dir in extra_dirs:
        for dirname, dirs, files in walk(extra_dir):
            if 'bower_components' in dirs:
                dirs.remove('bower_components')
            for filename in files:
                filename = path.join(dirname, filename)
                if path.isfile(filename):
                    extra_files.append(filename)

"""This starts the Flask server"""
if "HEROKU" in environ:
    port = int(environ.get('PORT', 5000))
    flask_app.run(host='0.0.0.0', port=port)
else:
    flask_app.run(debug=True, extra_files=extra_files)