2.0.0 Alpha: Data Refinery

This commit is contained in:
2026-08-08 21:31:56 +08:00
parent fa75081d4d
commit 562775e5db
48 changed files with 4172 additions and 661 deletions
+10 -13
View File
@@ -1,20 +1,20 @@
import sys
import os
# Add the project root directory to sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from flask import Flask, render_template
from flask import Flask
from web.config import Config
from web.database import close_dbs
from web.database import close_dbs, initialize_web_db
def create_app():
def create_app(config_object=Config):
app = Flask(__name__)
app.config.from_object(Config)
app.config.from_object(config_object)
initialize_web_db()
app.teardown_appcontext(close_dbs)
# Register Blueprints
from web.routes import main, matches, players, teams, tactics, admin, wiki, opponents
app.register_blueprint(main.bp)
app.register_blueprint(matches.bp)
@@ -24,13 +24,10 @@ def create_app():
app.register_blueprint(admin.bp)
app.register_blueprint(wiki.bp)
app.register_blueprint(opponents.bp)
@app.route('/')
def index():
return render_template('home/index.html')
return app
if __name__ == '__main__':
app = create_app()
app.run(debug=True, port=5000)