23 lines
688 B
Python
23 lines
688 B
Python
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) |