Главное меню
Но список запросов пока представляет собой просто один запрос
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from flask import Flask, render_template, session
|
||||
from Queries.requests import requests_bp
|
||||
from Auth.auth import auth_bp
|
||||
from os import path
|
||||
from checker import check_auth
|
||||
import json
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = 'suplex'
|
||||
@@ -10,13 +12,14 @@ app.register_blueprint(requests_bp, url_prefix='/requests')
|
||||
app.register_blueprint(auth_bp, url_prefix='/auth')
|
||||
|
||||
@app.route('/')
|
||||
@check_auth
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
with open(path.join(path.dirname(__file__), 'datafiles/menu.json')) as f:
|
||||
urls = json.load(f)
|
||||
return render_template('main_menu.html', menu=urls, ses=session)
|
||||
|
||||
@app.route('/logout')
|
||||
@check_auth
|
||||
def logout():
|
||||
session.clear()
|
||||
return 'OK'
|
||||
return render_template('exit.html')
|
||||
app.run(port=5001, debug=True)
|
||||
Reference in New Issue
Block a user