Exemplo n.º 1
0
    加载全局扩展,顺序不能变,有依赖关系
    '''
    web.extensions = web.storage()

    # 1. 初始化db
    conn = "mysql://%(user)s:%(password)s@%(host)s:%(port)s/%(db)s?charset=utf8"
    conn = conn % dict(db=config.dbname, user=config.dbuser,
                       password=config.dbpassword, host=config.dbhost,
                       port=config.dbport)

    db.init(conn)
    web.extensions.db = db

    # 2. 挂载登录相关函数
    from app_login import account
    web.extensions.is_login = account.is_login
    web.extensions.get_userinfo = account.get_userinfo

    # 3. 挂载其它工具函数
    import utils
    web.utils = utils

load_extensions()

from webserver import app

wsgiapp = app.wsgifunc()

if __name__ == '__main__':
    app.run()
Exemplo n.º 2
0
from webserver import app

if __name__ == "__main__":
    app.run()
Exemplo n.º 3
0
# For running just the Flask server dyno, from the Procfile
from webserver import app
import os

if os.environ['DEBUG']:
    DEBUG = True
if __name__ == '__main__':
    app.run(debug=DEBUG,use_reloader=False)
Exemplo n.º 4
0
#!/usr/bin/python3
from webserver import app
app.config['zippath'] = '/media/d-link/Transmission/complete/fb2.Flibusta.Net'
app.run(host='0.0.0.0', port=13208, debug=False)
Exemplo n.º 5
0
from webserver import app

if __name__ == '__main__':
    app.secret_key = 'SECRET KEY'
    app.run(host="0.0.0.0", port=5000, debug=True)
Exemplo n.º 6
0
__author__ = 'litao'

from webserver import app
app.run(debug=True, host='0.0.0.0', port=8000)
Exemplo n.º 7
0
#!/usr/bin/python2.7

from webserver import app
app.run(host ='0.0.0.0', port=80, debug=True)
Exemplo n.º 8
0
 def serve(self):
     from webserver import app
     app.debug = True
     app.run()
from webserver import app
app.run(debug=True)
Exemplo n.º 10
0
def start_webserver():
    app.run()
Exemplo n.º 11
0
#!/usr/bin/env python3
from webserver.models import User
from webserver import app, db, views
from flask.cli import AppGroup

cli_group_db = AppGroup('db')


@cli_group_db.command('init')
def init_db():
    db.create_all()
    # TODO: configure default user here
    db.session.add(User(username="******", password="******"))
    db.session.add(User(username="******", password="******"))
    db.session.add(User(username="******", password="******"))
    db.session.commit()


@cli_group_db.command('drop')
def drop_db():
    db.drop_all()


app.cli.add_command(cli_group_db)

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=80)
Exemplo n.º 12
0
from sys import version_info

MIN_VERSION = (3, 7)
assert version_info >= MIN_VERSION, f'requires Python {".".join([str(n) for n in MIN_VERSION])} or newer'

from webserver import app as webservice

if __name__ == '__main__':
    webservice.run(host='0.0.0.0')
Exemplo n.º 13
0
from webserver import app

app.run(host="0.0.0.0")
Exemplo n.º 14
0
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from webserver import app
import config

config.Log = app.logger
if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=config.WEB_SERVER_PORT)
Exemplo n.º 15
0
###############################################################################
# Copyright (C) [2020] by Cambricon, Inc. All rights reserved
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
###############################################################################

from webserver import app

if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0", port=9099)
else:
    gunicorn_app = app
Exemplo n.º 16
0
def run():
    app.run(host='104.131.90.215')
Exemplo n.º 17
0
# -*- coding: utf-8 -*-
__author__ = "C. Sudama, Matthew Alhonte"
__license__ = "Apache License 2.0: http://www.apache.org/licenses/LICENSE-2.0"

from webserver import app as application

if __name__ == "__main__":
    application.run()
Exemplo n.º 18
0
def main():
    app.run(port=app.config.get("PORT"), host=app.config.get("HOST"))
    robot.off()