def run(): """Run WSGI server """ WSGIServer( ("", 8050), index.create_app(subpages=pages.subpages).server ).serve_forever()
from pymongo import MongoClient import pandas as pd import json from index import create_app mongo_client = MongoClient('mongodb://*****:*****@mongo:27017') mydb = mongo_client['trainData'] my_collection = mydb['train'] df = pd.read_csv('/app/train_data/train.csv') json_data = json.loads(df.to_json(orient='records')) create_app(json_data, my_collection)
from index import create_app app = create_app() if __name__ == "__main__": # app.run(debug=True) # dubug=True: server restarts automatically
from index import create_app from wsgicors import CORS app = CORS(create_app(), headers="*", methods="*", origin="*", maxage="86400")
def app(): app = create_app() yield app import os os.remove(toml_data["test"]["database_engine_dsn"].split('///')[1])
def app(): """ @summary A testing initialisation function @return our_app - Returns the created app """ our_app = create_app() return our_app