pre-commit changes

This commit is contained in:
2024-12-08 12:17:19 +03:00
parent 2852ce1f96
commit 87e9029b09
15 changed files with 400 additions and 293 deletions

View File

@@ -1,32 +1,52 @@
import json
import os
from Auth import auth_bp
from flask import Flask, render_template, session
from Report import report_bp
from Requests import requests_bp
from Waybill import waybill_bp
from Auth import auth_bp
from Report import report_bp
import os, json
app = Flask(__name__)
app.secret_key = 'suplex'
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'))
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.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('/')
@app.route("/")
def index():
return render_template('main_menu.html', ses=session)
return render_template("main_menu.html", ses=session)
@app.route('/logout')
@app.route("/logout")
def logout():
session.clear()
return render_template('main_menu.html', ses=session)
return render_template("main_menu.html", ses=session)
if __name__ == '__main__':
app.run(port=5002, host='0.0.0.0')
if __name__ == "__main__":
app.run(port=5002, host="0.0.0.0")