Ejemplo n.º 1
0
def start_app(config, botctl):
    app.config['SECRET_KEY'] = 'thisissupposedtobeasecret'
    app.config['botController'] = botctl
    SSL_CERT = config.get('SSL_CERT')
    SSL_KEY =  config.get('SSL_KEY')
    context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
    context.load_cert_chain(SSL_CERT, SSL_KEY)
    app.run(host='0.0.0.0', port=443, debug=False, ssl_context=context, use_reloader=False, threaded=True)
Ejemplo n.º 2
0
 def start_server(self):
     """
         This method is used in order to start the server
         :return: None
     """
     app.run(host=str(self.__constants.host),
             port=int(self.__constants.port),
             debug=bool(self.__constants.runindebug))
Ejemplo n.º 3
0
def init() -> None:
    """Initializes the web application and starts the processing loop."""
    sys.stdout.write(header)
    sys.stdout.write('[+] Initializing web application ...\r\n')
    sys.stdout.write(
        '[+] Warning: Please make sure that no other services are using {}:{}\r\n\r\n'
        .format(host, port))

    app.run(host=host, port=port)
Ejemplo n.º 4
0
from routes import app
if __name__ == "__main__":
    app.run(port=8080,host='0.0.0.0',debug=True)
Ejemplo n.º 5
0
from routes import app

if __name__ == "__main__":
    app.run(debug=True, port=3002)
from routes import app

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5002, debug=True)
Ejemplo n.º 7
0
from routes import app

app.debug = True
app.run(host='0.0.0.0', port=3000)
Ejemplo n.º 8
0
Archivo: run.py Proyecto: Nanway/trains
from routes import app

if __name__ == '__main__':
    app.run(debug=True)
from routes import app

if __name__ == '__main__':
    app.run(port=5004, debug=True)
Ejemplo n.º 10
0
__author__ = 'karnikamit'
from routes import app


port = int(raw_input("port to run on "))
if __name__ == "__main__":
    app.run(port=port)
Ejemplo n.º 11
0
def start(debug=False):
    app.run(host="0.0.0.0", port=1337)
    app.debug = debug
Ejemplo n.º 12
0
# _*_ coding:utf-8 _*_
from routes import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=9999)
Ejemplo n.º 13
0
def start(debug=False):
    app.run(host="0.0.0.0", port=8080, threaded=True)
    app.debug = debug
Ejemplo n.º 14
0
__author__ = 'karnikamit'
from routes import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=1234, debug=True)
Ejemplo n.º 15
0
# -*- coding: utf-8 -*-

from routes import app

if __name__ == "__main__":
    app.run(host='0.0.0.0')
Ejemplo n.º 16
0
# coding: utf-8
# email: [email protected]

from routes import app

if __name__ == '__main__':
    app.run(debug=True, port=1991)
Ejemplo n.º 17
0
import os

from routes import app

app.secret_key = 'development key'

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///data//mydb.db'

from models import db
db.init_app(app)

from admin import admin
admin.init_app(app)

import routes

if __name__ == "__main__":
    port = int(os.environ.get("PORT", 5000))
    app.run(host='0.0.0.0', port=port)
Ejemplo n.º 18
0
from routes import app

# Finally run
app.run(debug=True, port=80)
Ejemplo n.º 19
0
def main(port):
  app.run(host="0.0.0.0", port=port, debug=True)
  socketio.run(app)
Ejemplo n.º 20
0
from routes import app

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

if __name__ == '__main__':
    app.run(host='0.0.0.0',port=80)
Ejemplo n.º 22
0
from routes import app

if __name__ == '__main__':
    # SIGINT to stop (Ctrl + C)
    app.run(host='127.0.0.1', port=6969)
Ejemplo n.º 23
0
#
from flask import Blueprint
from routes import app

# main = Blueprint('main', __name__, template_folder='templates', static_folder='static')
#
# # Import blueprints
# app.register_blueprint(main)
#




# gunicorn wsgi:app -b 0.0.0.0:8000
# gunicorn --log-file=- onbytes.wsgi:application

if __name__ == '__main__':
    app.run()





Ejemplo n.º 24
0
### from routes obtains info from routes.py and import all "app" info
from routes import app

if __name__ == "__main__":
    app.run(debug=True, port=5000, host='0.0.0.0')
Ejemplo n.º 25
0
from routes import app

if __name__ == '__main__':
    app.run(host='localhost', debug=True, port=8000)
Ejemplo n.º 26
0
from routes import app

if __name__ == '__main__':
    app.run(port=568462, debug=True)
from routes import app


if __name__ == "__main__":
    app.run(debug=True, port=5000, host='0.0.0.0')
Ejemplo n.º 28
0
from routes import app

if __name__ == '__main__':
    app.run(debug=True, port=1111)
Ejemplo n.º 29
0
from config import flask_config
from db import create_table, drop_table
from routes import app
from tools import create_submissions_directory

if __name__ == "__main__":
    # create_submissions_directory()
    # drop_table()
    create_table()
    app.run(**flask_config)
Ejemplo n.º 30
0
from routes import app

if __name__ == "__main__":
    app.run(host="localhost", port=5000, use_reloader=True, threaded=True)
Ejemplo n.º 31
0
from routes import app, UPLOAD_FOLDER

app.config["UPLOAD_FOLDER"] = UPLOAD_FOLDER
app.run(
	host="0.0.0.0",
	port=int(5000),
	debug=True
	)
Ejemplo n.º 32
0
#!/usr/bin/env python

from flask import Flask
from routes import app

if __name__ == '__main__':

    app.run(debug=True, port=4100)
Ejemplo n.º 33
0
from routes import app

if __name__ == '__main__':
    # SIGINT to stop (Ctrl + C)
    app.run(port=8000, debug=True)

    # Saves the data
Ejemplo n.º 34
0
import logging
import sys, getopt

##load the web app
from routes import app

if __name__ == "__main__":
    try:
        opts, args = getopt.getopt(sys.argv[1:], "d", ["debbug"])
        opts = [opt[0] for opt in opts]
    except getopt.GetoptError as e:
        logging.error(e)
        sys.exit(2)

    if '-d' in opts or '--debbug' in opts:
        logging.basicConfig(level=logging.INFO)
        app.run(debug=True)
    else:
        logging.basicConfig(level=logging.WARNING)
        app.run(debug=False)
Ejemplo n.º 35
0
from routes import app

if __name__=="__main__":
    app.run(port="8000")
Ejemplo n.º 36
0
from routes import app

if __name__ == '__main__':
    # SIGINT to stop (Ctrl + C)
    app.run(debug=True, port=6969)
Ejemplo n.º 37
0
import os
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop

from logger import logger
from routes import app

# read port
port = int(os.environ["PORT"])

# start wsgi server
if app.config["DEBUG"]:
    logger.debug("starting in debug mode. port=%i" % port)
    app.run(debug=True, port=port)
else:
    logger.debug("starting in production mode. port=%i" % port)

    http_server = HTTPServer(WSGIContainer(app))
    http_server.listen(port)

    try:
        IOLoop.instance().start()
    except KeyboardInterrupt:
        IOLoop.instance().stop()
Ejemplo n.º 38
0
from routes import app

if __name__ == '__main__':
    # SIGINT to stop (Ctrl + C)
    app.run(debug=True)
Ejemplo n.º 39
0
"""
In this file you will find the code to run de app.
The app is imported from routes because 
the endpoint was defined there.
"""
#Importing
from config import os, db
from routes import app

if __name__ == '__main__':
    #In this piece of code the tables are created if they don´t exist
    #in the database
    if not os.path.exists('db.sqlite'):
        db.create_all()
    #Here the debug mode is turned off,
    #the port is defined, and the app is run
    app.run(host='0.0.0.0', debug=False, port=8080)
Ejemplo n.º 40
0
# RUN file
from routes import app

if __name__ == '__main__':
    app.run(debug=True, port=5000)
Ejemplo n.º 41
0
 def run(self):
     app.run(debug=True, use_reloader=False)
Ejemplo n.º 42
0
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @file: main.py
# @date: 2021/04/24
from routes import app

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)
Ejemplo n.º 43
0
    parser = ArgumentParser(
        description='Web server for mushroom gathering data collection',
        epilog='Easy config setup advice: copy and modify existing .json to config.json')
    parser.add_argument('-c', '--config',
        help='Load configuration from alternate file',
        default='config.json')
    parser.add_argument('-r','--reload',
        help='Reload db from schema and exit',
        action='store_true')
    args = parser.parse_args()

    # Read config
    import json
    with open(args.config) as config_file:
        config = json.loads(config_file.read())

    # Database initialization
    from database import get_database
    app.db = get_database(config)
    if args.reload:
        app.db.reinitialize()
        quit()

    # Run server
    app.secret_key = 'development key'
    params = {
        'debug': config.get('debug', False),
        'port': config.get('port', 5000)
    }
    app.run(**params)