dwm-app/app.py

48 lines
1.2 KiB
Python
Raw Normal View History

from flask import Flask, render_template
2024-02-15 15:46:33 +00:00
from src.util.utils import *
from src.api.get_monsters import *
from src.api.get_families import *
from src.api.get_monster_stats import *
2024-02-22 03:23:13 +00:00
from src.api.get_breeding_pairs import *
2024-02-22 15:58:22 +00:00
from src.api.get_breeding_usage import *
2024-02-28 20:01:43 +00:00
from src.api.get_skills_data import *
2024-01-30 16:06:00 +00:00
2024-02-28 20:15:08 +00:00
from src.util.serve_media import *
2024-02-23 21:28:37 +00:00
#from src.views.skills import *
2024-02-14 20:55:41 +00:00
app = Flask(__name__)
2024-01-30 16:06:00 +00:00
# Utils
app.before_request(before_request)
app.teardown_request(teardown_request)
2024-02-02 02:52:59 +00:00
# Register API Blueprints
app.register_blueprint(get_families_bp)
app.register_blueprint(get_monsters_bp)
app.register_blueprint(get_monster_stats_bp)
2024-02-22 03:23:13 +00:00
app.register_blueprint(get_breeding_pairs_bp)
2024-02-22 15:58:22 +00:00
app.register_blueprint(get_breeding_usage_bp)
2024-02-28 20:01:43 +00:00
app.register_blueprint(get_skills_data_bp)
2024-02-15 15:46:33 +00:00
# Register Serve Content Blueprints
2024-02-28 20:15:08 +00:00
app.register_blueprint(serve_media)
2024-02-15 15:46:33 +00:00
# Register Other Views Blurprints (HTML Render Templates)
#app.register_blueprint(skills_bp)
2024-02-15 15:46:33 +00:00
2024-02-02 02:52:59 +00:00
@app.route("/")
2024-02-04 20:21:15 +00:00
def show_app():
js_files = get_js_files()
2024-02-04 20:21:15 +00:00
return render_template("app.html", js_files=js_files)
2024-01-30 16:06:00 +00:00
@app.route('/skills')
def skills():
csv_data = read_csv('static/data/skills_data.csv')
return render_template('skills.html', csv_data=csv_data)
2024-01-30 23:21:26 +00:00
if __name__ == "__main__":
2024-01-30 16:06:00 +00:00
app.run(debug=True)