示例#1
0
文件: initArgs.py 项目: A1B23/Chain
def main(typeIn):
    m_info['type'] = typeIn
    m_cfg['type'] = typeIn
    parser = ArgumentParser()
    host, port, peer = init(parser)
    thread = Thread(target=finalise, args=(host, peer, port))
    thread.start()
    app.run(host=host, port=port, threaded=True)
示例#2
0
def main(argv):
    try:
        opts, args = getopt.getopt(argv, "hu:m:r:",
                                   ["user="******"module=", "retrieve="])
    except getopt.GetoptError:
        print(cmd_helper())
        sys.exit(2)

    user_file = None
    module_file = None
    job_uuid = None

    for opt, arg in opts:
        if opt == '-h':
            print(cmd_helper())
            sys.exit()
        if opt in ("-u", "--user"):
            user_file = os.path.normpath(arg)
        if opt in ("-m", "--module"):
            module_file = os.path.normpath(arg)
        if opt in ("-r", "--retrieve"):
            job_uuid = str(arg)

    try:
        if user_file is not None:
            if module_file is not None:
                # Launch staging w/ user input and staging module sequence
                app.run_with_module(user_file, module_file)
            else:
                # Launch staging on User Input only
                app.run(user_file)
        elif job_uuid is not None:
            app.retrieve(job_uuid)
        else:
            print(cmd_helper())
    except BaseException as err:
        print(err)
示例#3
0
from project import app

if __name__ == "__main__":
    app.run(debug=True, host='0.0.0.0', port=5000)
示例#4
0
from project import app


if __name__ == "__main__":
    app.run(host='127.0.0.1', port=5000)
示例#5
0
#!/usr/bin/env python

from project import app
from project.model import evaluate

if __name__ == '__main__':
    app.run('0.0.0.0', debug=True)
示例#6
0
import os
from project import app

port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port, debug=True)
from project import app


if __name__ == '__main__':
    app.run()
示例#8
0
from project import app

app.run(port=8888)
示例#9
0
from project import app, settings

# Main com Run pra rodar com o python -m
if __name__ == "__main__":
    app.run(host=settings.FLASK_HOST,
            port=settings.FLASK_PORT,
            debug=settings.FLASK_DEBUG)
示例#10
0
def deploy():
    """
    Run server on port 8080 with deployment config.
    """
    configure_app(app, DeploymentConfig)
    app.run(host='0.0.0.0', port=8080)
示例#11
0
def testing():
    """
    Run server on port 8080 with testing config.
    """
    configure_app(app, TestingConfig)
    app.run(host='0.0.0.0', port=8080)
示例#12
0
# project/run.py

from project import app
app.run(debug=True, port=5001)
示例#13
0
def run():
    """
    Run server on port 8080 with default config.
    """
    app.run(host='0.0.0.0', port=8080)
示例#14
0
'''
Created on 17. aug. 2015

@author: Criblica
'''

from project import db, app
from project.models import *
from project.routes import *
import project.configs as configs



if __name__ == '__main__':
    
    #app.secret_key = 'This is my supersecret key that nobody knows about, except my butcher!!!'
    #app.run()
    app.config.from_object(configs.ProductionConfig)
    app.run(host="192.168.10.168", port=80, debug=True)
    #192.168.10.168
示例#15
0
from project import app
import os

port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port)
示例#16
0
def runserver(*args, **kwargs):    
    app.run(host='0.0.0.0', port=8000)
示例#17
0
#! python3.4
# -*- coding: utf-8 -*-
import json
from project import app, config

# Startup
if __name__ == '__main__':
    app.run(debug=config['app']['debug'],
            host=config['flask']['HOST'],
            port=config['flask']['PORT'])
示例#18
0
def custom_config(config_file):
    """
    Run server on port 8080 with custom config file.
    """
    configure_app(app, os.path.abspath(config_file), is_pyfile=True)
    app.run(host='0.0.0.0', port=8080)
示例#19
0
from project import app

if __name__ == '__main__':
    print('inside app')
    app.run(debug=True)
示例#20
0
"""Run file.
   
  Author: Razen Chris Marling
  Date: Feb 04, 2018
  Project Name: Rocka Village Inventory System - API
  Description for this file: this is the heart of the project
"""

from project import app

if __name__ == '__main__':
    app.run(host=app.config['BIND_IP'],
            port=app.config['BIND_PORT'],
            debug=app.config['DEBUG'])
示例#21
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from project import app
import dotenv

if __name__ == '__main__':
    CONFIG = dotenv.dotenv_values()
    port = int(os.environ.get("PORT", 5017))
    app.run("localhost", port=port)
示例#22
0
# -*- coding: utf-8 -*-

from project import app


if __name__ == '__main__':

    app.run(port=8092, debug=True)
示例#23
0
# from flask.cli import FlaskGroup
# from project import app, db, User

# cli = FlaskGroup(app)

# @cli.command("create_db")
# def create_db():
#     db.drop_all()
#     db.create_all()
#     db.session.commit()

# @cli.command("seed_db")
# def seed_db():
#     db.session.add(User(email="*****@*****.**"))
#     db.session.commit()

# if __name__ == "__main__":
#     cli()from project import app
from project import app

if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0")
示例#24
0
文件: run.py 项目: usorio/unplanet
from project import app
app.run(host="0.0.0.0",port=80)
import os
from project import app

if __name__ == '__main__':
    port = int(os.environ.get("PORT", 5000))
    app.run('127.0.0.1', port=port)
示例#26
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from project import app
from project.models import printer

if __name__=='__main__':
    app.run('0.0.0.0',debug=True)
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
.. module:: run
    :platform: Unix, Windows
    :synopsis: The app run file.

.. moduleauthor:: Charles Wood <*****@*****.**>
"""

import os
from project import app

DEBUG = os.getenv('DEBUG', 'True') == 'True'
PORT = os.getenv('PORT', '5000')
HOST = os.getenv('HOST', 'localhost')

if __name__ == '__main__':
    app.run(host=HOST, port=int(PORT), debug=DEBUG)
示例#28
0
from project import app
from sys import argv

if __name__ == '__main__':
    if len(argv) == 2 and argv[1] == "-noreload":
        app.run(use_reloader=False)
    else:
        app.run()
示例#29
0
from project import app


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

示例#30
0
文件: run.py 项目: mjhea0/Sano
def run():
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
from project import app

app.run(port=8838)

##@app.route('/')
##def hello_world():
##  return render_template('admin/index.html')

##@app.route('/addCategory')
##def addCategory():
##  return render_template('admin/addCategory.html')

##@app.route('/addSubcategory')
##def viewSubcategory():
##  return render_template('admin/addSubcategory.html')

##@app.route('/viewReatiler')
##def viewReatiler():
##  return render_template('admin/viewReatiler.html')

##@app.route('/viewDistributor')
##def viewDistributor():
##  return render_template('admin/viewDistributor.html')

##@app.route('/viewProduct')
####  return render_template('admin/viewProduct.html')

##@app.route('/addProduct')
##def addProduct():
##    return render_template('admin/addProduct.html')
示例#32
0
文件: manage.py 项目: anxolerd/Meowth
def run():
    """ Run application """
    app.run(debug=True)
示例#33
0
from project import app

app.run(threaded=True, port=5678)
示例#34
0
from project import app

app.run(port=8000)
示例#35
0
from project import app
from project import build_sample_db
import os

createcount = 0
    
if __name__ == '__main__':

    # Build a sample db on the fly, if one does not exist yet.
    app_dir = os.path.realpath(os.path.dirname(__file__))
    proj_dir = 'project'
    database_path = os.path.join(app_dir, proj_dir, app.config['DATABASE_FILE'])
    if not os.path.exists(database_path):
        build_sample_db()
    
    if createcount == 0:
        build_sample_db()    
        createcount = 1
        

    app.run(host='0.0.0.0', port=5000, debug=True)
示例#36
0
from project import app


if __name__ == '__main__':
    app.run(host = '0.0.0.0')
示例#37
0
# FlaskTaskr/run.py
import os
from project import app

port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)
示例#38
0
def main():
    debug = False

    if len(argv) > 1 and argv[1] == "debug":
        debug = True
    app.run(host="0.0.0.0", debug=debug)
示例#39
0
from project import app

if __name__ == '__main__':
    app.run(debug=app.config['DEBUG'], port=app.config['PORT'])
from project import app
from project.config import config

if __name__ == '__main__':
    app.run(host=config['HOST'], port=config['PORT'], debug=config['DEBUG'])
### IMPORT REQUIRED PYTHON MODULES ###
import json
from project import app

### START THE APP ###
if __name__ == '__main__':
    app.run(host="0.0.0.0", port="8080")
示例#42
0
from project import app

app.run(debug=True, host='0.0.0.0', port=5000)
示例#43
0
    """
    geolocator = Nominatim()
    location = geolocator.geocode("%s %s %s %s" % (street_address, city, state, country))
    return location.latitude, location.longitude


def get_address_from_coordinates(latitude, longitude):
    """ Get a street address from coordinates

    :param latitude: Starting latitude
    :param longitude: Starting longitude
    :return:
    """
    geolocator = Nominatim()
    location = geolocator.reverse("%.2f, %.2f" % (float(latitude), float(longitude)))
    return location.address


@app.route("/get_data", methods=['POST'])
@login_required
def get_data():
    """ Handles asynchronous request to get information about a food pantry on the front-end form

    :return: Data about the food pantry
    """
    destination = request.form['destination']
    return jsonify(marker_addresses[destination])

if __name__ == "__main__":
    app.run(debug=True)
示例#44
0
from project import app
from project.application import configure_app
from project.config import ProductionConfig

configure_app(app, ProductionConfig())


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8080)
示例#45
0
from project import app

if __name__ == '__main__':
    app.run(threaded=True)
示例#46
0
from project import app


if __name__ == '__main__':
    app.run(host="0.0.0.0")
from project import app

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=9000)
示例#48
0
from project import app
#app.run(debug = False)
app.run(debug = True, port=4000, host='0.0.0.0')
示例#49
0
#!/usr/bin/env python3

from project import app

if __name__ == "__main__":
    app.run(host='0.0.0.0')
#!/usr/bin/env python
from project import app

if __name__ == '__main__':
    app.run('0.0.0.0')
示例#51
0
from project import app, db
from flask_restful import Resource, Api
from flask_restful import Api
from project.users.views import SendSerial
from project.admin.views import Login, Logout, PostProduct, GetProduct, GetPhone, Getby, Request

api = Api(app)

api.add_resource(SendSerial, '/SendSerial')

api.add_resource(Login, '/login-admin')
api.add_resource(Logout, '/logout-user')
api.add_resource(PostProduct, '/PostProduct')
api.add_resource(GetProduct, '/GetProduct')
api.add_resource(GetPhone, '/GetPhone')
api.add_resource(Getby, '/Getby')
api.add_resource(Request, '/Request')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)
示例#52
0
# -*- coding: utf-8 -*-

import os
from project import app

if __name__ == '__main__':
    port = int(os.environ.get("PORT", 8080))
    app.run('0.0.0.0', port=port)
示例#53
0
from project import app

if __name__ == "__main__":
    app.run(port=8000)
示例#54
0
文件: run.py 项目: onrmdc/meraki-opui
#!/usr/bin/env python3
from project import app
import sys

if __name__ == '__main__':
    if len(sys.argv) > 1:
        app.run(host=sys.argv[1])
    else:
        app.run(host='0.0.0.0', port='5000')
示例#55
0
from project import app

app.run(port=1564, threaded=True)





示例#56
0
DEBUG = False

from project import app

if __name__ == "__main__":
    app.run(host="192.168.4.112", port=5000)
示例#57
0
文件: run.py 项目: Melvie/BeerShed
from project import  app


if __name__ == '__main__':

    app.run()
示例#58
0
from project import app

if __name__ == '__main__':
    app.run(host=app.config.get('HOST'), port=app.config.get('PORT'))
示例#59
0
import os
from project import app

port=int(os.environ.get('PORT',5000))
app.run(host='0.0.0.0',port=port)
示例#60
0
文件: app.py 项目: kruthik-jt/Signzy
from project import app, db
#Run the application
if __name__ == '__main__':
    app.run(debug=True, port=5000)