from templates import app if __name__ == "__main__": app.run(threaded=True)
from templates import app app.config.from_object('configurations.DevelopmentConfig') port = 5000 if __name__ == '__main__': app.run(port=port)
from templates import app if __name__ == '__main__': app.config.from_object('configurations.DevelopmentConfig') app.run()
"select * from time_history where id = {} order by cast(time as float) asc" .format(current_team)) time_history = cur.fetchall() if is_watching and len(time_history) != 0: print("Best time: {}".format(time_history[0])) best_time = time_history[0]['time'] cur = con.cursor() cur.execute( "update middle_score set time = {} where id = {}" .format(best_time, current_team)) con.commit() print("Updated!") temp_string = [] f.flush() serial_device.close() if __name__ == '__main__': recording_on = Value('b', True) p = Process(target=record_loop, args=(recording_on, )) p.start() app.config.from_object('configurations.DevelopmentConfig') app.run(use_reloader=False) p.join()
from templates import app #Load this config object for development mode app.config.from_object('configurations.DevelopmentConfig') app.run(host="0.0.0.0")
from templates import app app.run(host='0.0.0.0', port=40011)
#!/usr/bin/env python from templates import app, db if __name__ == "__main__": #app.debug = True # Because we did not initialize Flask-SQLAlchemy with an application # it will use `current_app` instead. Since we are not in an application # context right now, we will instead pass in the configured application # into our `create_all` call. #db.create_all(app=app) app.run(port=33507)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 7 21:56:38 2020 @author: olayinkaotuniyi """ import platform from os import path, walk from templates import app # Load this config object for development mode app.config.from_object('config.DevelopmentConfig') def before_request(): app.jinja_env.cache = {} app.before_request(before_request) app.run(host='localhost', port=3030, debug=True)
cmd = sys.argv[1] if cmd == "generate": es = GeoElasticSearch('localhost', 9200, GeoElasticSearch.GEO_POINTS, 'location') if len(sys.argv) > 1: count = int(sys.argv[2]) else: count = 10000 geo_points = GeoPointGen.generate_with_world_bounds(count) es.upload_points(geo_points) elif cmd == "test": es = GeoElasticSearch('localhost', 9200, GeoElasticSearch.GEO_POINTS, 'location') clustering = GeoClustering(es) clustering.compute_clusters(0, int(sys.argv[2]), GeoSwNe(-90, -180, 90, 180)) elif cmd == "webapp": if __name__ == '__main__': app.run('0.0.0.0', 5000) else: raise 'Unknown command'
from templates import app if __name__ == '__main__': app.run(debug=True)
from templates import app #Load this config object for development mode app.config.from_object('configurations.DevelopmentConfig') if __name__ == '__main__': app.run(port=9999, threaded=True)
import os from templates import app #Load this config object for development mode app.config.from_object('configurations.DevelopmentConfig') port = int(os.environ.get('PORT', 5000)) app.run(port=port, host='0.0.0.0')
from templates import app from server.restful import NoahFightLog, NoahMembersList, NoahMemberFightLog app.config.from_object('configurations.DevelopmentConfig') @app.route('/api/v1/noah-fight-logs', methods=['GET']) def getFightLogs(): res = NoahFightLog() return res.get() @app.route('/api/v1/noah-member-list', methods=['GET']) def getMembersList(): res = NoahMembersList() return res.get() @app.route('/api/v1/noah-member-fight-logs/<playerid>', methods=['GET']) def getMemberDetails(playerid): res = NoahMemberFightLog() return res.get(playerid) if __name__ == '__main__': app.run(debug=True, port=5002)
from flask import Flask from flask import render_template, request, jsonify #from flask_restplusu import Api import csv import json from sklearn.datasets import make_classification import pickle from nltk import sent_tokenize from templates import app #Load this config object for development mode app.config.from_object('configurations.DevelopmentConfig') app.run() #model stuff #clf = pickle.load(open('model', 'rb')) testdata = {'theme': 'family', 'quotes': ['Blah Blah Blah', 'Lorem ipsum']} app = Flask(__name__) #api = Api(app) @app.route('/') def render(): return render_template("templates/static/index.html") @app.route('/api')
from flask import Flask from templates import app app.config.from_object('configurations.DevelopmentConfig') app.secret_key = 'mysecret' app.run(port="5009")
from templates import app from templates.src.utils import load_config config = load_config() #Load this config object for development mode app.config.from_object('configurations.DevelopmentConfig') app.run(host='0.0.0.0', port=config['local_port'])