コード例 #1
0
    if not isExists:
        # 如果不存在则创建目录
        print path+' create success'
        # 创建目录操作函数
        os.makedirs(path)
        return True
    else:
        # 如果目录存在则不创建,并提示目录已存在
        print path+' is exist'
        return False

#计算路径,然后创建文件夹
curPath = os.path.split(os.path.realpath(__file__))[0]
logsPath = curPath + os.sep + 'logs'

mkdirFn(logsPath)


from restapi.controllers import *
from restapi.models import *
from restapi.route import *

#db access
db.create_all()

if __name__ == '__main__':
    app.run(host=app.config.get("HOST"),port=app.config.get("PORT"))
    
    
    
コード例 #2
0
ファイル: backend.py プロジェクト: 9321ass2/Assignment2
from restapi import app, api_info, DataToday, country_df
from flask_cors import CORS

if __name__ == '__main__':
    import namespaces.authentication
    import namespaces.user
    import namespaces.predict
    import namespaces.games
    import namespaces.country
    import namespaces.recom
    import namespaces.usage
    DataToday()
    app.run(debug=True)
    CORS(app)
コード例 #3
0
from restapi import app
from flask_restful import Resource, Api
from restapi import controller

if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)
コード例 #4
0
#计算路径,然后创建文件夹
curPath = os.path.split(os.path.realpath(__file__))[0]
logsPath = curPath + os.sep + 'logs'

mkdirFn(logsPath)

from restapi.models.dbModel import db
from restapi.models.userModel import UserModel

if __scritpEnv.lower() != "debug" :
    import logging
    log = logging.getLogger('werkzeug')
    log.setLevel(logging.ERROR)

#db access
db.create_all()
from restapi.route import *

if __name__ == '__main__':
    if __scritpEnv.lower() == "debug" :
        app.run(host=app.config.get("HOST"),port=app.config.get("PORT"))
    else:
        app.wsgi_app = ProxyFix(app.wsgi_app)
        app.run(threaded=True)
elif __scritpEnv.lower() != "debug" :
    app.wsgi_app = ProxyFix(app.wsgi_app)

    
    

コード例 #5
0
ファイル: run.py プロジェクト: weacw/flask-restapi-recipe
                     action="store_true", dest="run")
group_ops.add_option("-z", "--shell",
                     help="Run shell",
                     action="store_true", dest="shell")
group_ops.add_option("-i", "--init",
                     help="Initialize the application (first use)",
                     action="store_true", dest="init")

parser.add_option_group(group_ops)

(options, args) = parser.parse_args()

if options.run is True:
    from restapi import app, db
    print("Starting the Development HTTP server..")
    app.run(debug=True, host="0.0.0.0")

elif options.init is True:
    from restapi import app, db
    print("Creating database..")
    db.create_all()

elif options.shell:
    from restapi import app, db
    with app.app_context():
        code.interact(local={
            "app": app,
            "db": db
        })

else:
コード例 #6
0
ファイル: __main__.py プロジェクト: logileifs/gateway
from restapi import app
app.run()
コード例 #7
0
from restapi import app
if __name__ == "__main__":
    app.run(host="0.0.0.0")