コード例 #1
0
import sys
import os
CURRENT_FILE = os.path.abspath(__file__)
CURRENT_DIR = os.path.dirname(CURRENT_FILE)
sys.path.append(CURRENT_DIR)
sys.path.append(CURRENT_DIR + '/services/')
sys.path.append(CURRENT_DIR + '/Server/')
sys.path.append(CURRENT_DIR + '/venv/lib/python3.8/site-packages/')

from Server import app
import Server.views
from Server.settings import SERVER_HOST, SERVER_PORT
import Server.settings as ss

# start flask service
if __name__ == "__main__":
    app.run(host=SERVER_HOST, port=SERVER_PORT, debug=True, threaded=True)
コード例 #2
0
ファイル: runserver.py プロジェクト: riotopsys/mal_api_next
__author__ = 'adam.fitzgerald'

from Server import app, set_user_agent
import ConfigParser
import sys
import memcache

config = ConfigParser.ConfigParser()

config.read("config.cfg")

port = config.get('global','port')
user_agent = config.get('global','user_agent')
debug = config.get('global', 'debug')

if user_agent is None:
    print 'user_agent is required'
    sys.exit(-1)

set_user_agent(user_agent)


app.config['JSON_AS_ASCII'] = False
app.memcached = memcache.Client([config.get('global','memcached')], debug=1)

if __name__ == '__main__':
    port = int(port)
    app.debug = True
    app.run('0.0.0.0', port)
コード例 #3
0
from Server import app
import os
DATA_DIRECTORY = os.getcwd() + "\\server_files\\"

if __name__ == '__main__':
    if not os.path.exists(DATA_DIRECTORY):
        os.mkdir(DATA_DIRECTORY)
    print("Server started..")
    # app.run(host='192.168.1.5', port=8004, threaded=False)
    app.run(host='192.168.0.17', port=8004, threaded=False)
    print("Server stoped..")
コード例 #4
0
"""
This script runs the Scrapple application using a development server.
"""

from os import environ
from Server import app
from Scrapple import scrapple

if __name__ == '__main__':
    #tesing code please remove
    scrapple.intialize()
    #scrapple.start_scraper("craigslist")
    #scrapple.run_spiders()

    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555

    print("Server starting")
    app.run(HOST, PORT)
コード例 #5
0
#!env/bin/python3

__author__ = 'LimeQM'

from Server import app, db
from flask_migrate import Migrate

migrate = Migrate(app, db)


class debug():
    app = app

    def run(self):
        app.run(host='0.0.0.0', debug=True)


if __name__ == "__main__":
    # db.create_all(app=app)
    # db.session.commit()
    app.run(host='0.0.0.0', debug=True)
コード例 #6
0
 def run(self):
     app.run(host='0.0.0.0', debug=True)
コード例 #7
0
ファイル: run.py プロジェクト: ItayS14/Voice-Assistant
from Server import app

if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')
コード例 #8
0
ファイル: debug.py プロジェクト: Boscillator/PlasticDB
from Server import app
app.run(debug=True)
コード例 #9
0
from Server import app

if __name__ == '__main__':
    app.run(host='0.0.0.0')
    return "Just used to log in"


@app.route('/login', methods=['POST', 'GET'])
def login():
    r = request.get_json()

    user = models.User.query.filter_by(email=r["email"]).first()
    if user and user.password == r["password"]:
        return {"username": user.username, "token": hashlib.sha256(bytes(user.username+user.password+salt, "utf-8")).hexdigest()}

    return "invalid Email or Password"


@app.route('/routes', methods=['POST', 'GET'])
def routes():
    r = request.get_json()
    user = models.User.query.filter_by(username=r["username"]).first()
    print(user)
    print(user.routes)
    #if user and hashlib.sha256(bytes(user.username+user.password+salt)).hexdigest() == r["token"]:
        #return jsonify(routes=user.routes)
        #pass
    print({"routes": [{"id": i.id, "lat": i.end_lat, "lon": i.end_lon} for i in user.routes]})
    return {"routes": [{"id": i.id, "lat": i.end_lat, "lon": i.end_lon} for i in user.routes]}


if __name__ == '__main__':
    app.run(debug=True)
コード例 #11
0
sys.path.append(CURRENT_DIR)
sys.path.append(CURRENT_DIR + '/services/')
sys.path.append(CURRENT_DIR + '/Server/')

from Server import app
import Server.views
from Server.logger import logger
from Server.settings import SERVER_HOST, SERVER_PORT
import Server.settings as ss
from apscheduler.schedulers.background import BackgroundScheduler
from Server.job import JOB
from datetime import datetime

logger.info("Start Server")

# start scheduler
scheduler = BackgroundScheduler()
scheduler.add_job(JOB,
                  ss.SCHEDULER_MODE,
                  seconds=ss.SCHEDULER_INTERVAL,
                  next_run_time=datetime.now())
scheduler.start()

# start flask service
if __name__ == "__main__":
    app.run(host=SERVER_HOST,
            port=SERVER_PORT,
            debug=True,
            threaded=True,
            use_reloader=False)
コード例 #12
0
from Server import app

if __name__ == "__main__":
    app.run()
コード例 #13
0
ファイル: app.py プロジェクト: Adrian-Zheng/PassBank
 def run(self):
     app.run(host='0.0.0.0', debug=True)
コード例 #14
0
ファイル: wsgi.py プロジェクト: etwest/confidential-reporting
from Server import app

if __name__ == "__main__":
    app.run(threaded=True)
コード例 #15
0
ファイル: production.py プロジェクト: Boscillator/LHCforChem
"""
Runnes server for production use
"""

from Server import app

app.run(host='0.0.0.0',port=80)