This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RIS/App/app.py

53 lines
1.2 KiB
Python

import json
import os
from Auth import auth_bp
from flask import Flask, redirect, render_template, session
from Report import report_bp
from Requests import requests_bp
from Waybill import waybill_bp
app = Flask(__name__)
app.secret_key = "suplex"
app.config.update(
db_config=json.load(
open(
os.path.join(os.path.dirname(__file__), "data/config.json"),
encoding="utf-8",
)
),
db_access=json.load(
open(
os.path.join(os.path.dirname(__file__), "data/db_access.json"),
encoding="utf-8",
)
),
cache_config=json.load(
open(
os.path.join(os.path.dirname(__file__), "data/redis_config.json"),
encoding="utf-8",
)
),
)
app.register_blueprint(requests_bp, url_prefix="/requests")
app.register_blueprint(auth_bp, url_prefix="/auth")
app.register_blueprint(report_bp, url_prefix="/report")
app.register_blueprint(waybill_bp, url_prefix="/waybill")
@app.route("/")
def index():
return render_template("main_menu.html", ses=session)
@app.route("/logout")
def logout():
session.clear()
return redirect("/")
if __name__ == "__main__":
app.run(port=5002, host="0.0.0.0")