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
Anton Kamalov 339a55f8da Запрос по материалу заготовки
Доработать возвращение в меню запросов
2024-10-22 00:09:35 +03:00

23 lines
688 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from flask import Flask, redirect, render_template, url_for, session, request
from os import path
from Queries.req import requests_bp
import json
app = Flask(__name__)
app.secret_key = 'super secret key'
with open(path.join(path.dirname(__file__), 'db/config.json')) as f:
app.config['db_config'] = json.load(f)
app.register_blueprint(requests_bp, url_prefix='/requests')
@app.route('/')
def index():
session['db_config'] = app.config['db_config'] # Временное решение до момента с авторизацией
return render_template('index.html')
@app.route('/logout')
def logout():
session.clear()
return 'OK'
app.run(port=5001, debug=True)