Return template from call

This commit is contained in:
Sam Chow 2018-05-14 13:12:42 -04:00
parent 92db413da6
commit 15c15faf30
5 changed files with 105 additions and 279 deletions

View file

@ -5,25 +5,26 @@ import logging
from datetime import timedelta, datetime
from cachetools import lru_cache
from flask import (abort, redirect, request, url_for, make_response, Response, render_template,
Blueprint, jsonify, send_file, session)
from flask_login import current_user
# from flask import (abort, redirect, request, url_for, make_response, Response, render_template,
# Blueprint, jsonify, send_file, session)
from flask import Blueprint
# from flask_login import current_user
from app import (app)
from endpoints.api.discovery import swagger_route_data
from endpoints.common import common_login, render_page_template
# from endpoints.api.discovery import swagger_route_data
from common import render_page_template
from util.cache import no_cache
@lru_cache(maxsize=1)
def _get_route_data():
return swagger_route_data(include_internal=True, compact=True)
# @lru_cache(maxsize=1)
# def _get_route_data():
# return swagger_route_data(include_internal=True, compact=True)
def render_page_template_with_routedata(name, *args, **kwargs):
return render_page_template(name, _get_route_data(), *args, **kwargs)
return render_page_template(name, *args, **kwargs)
# Capture the unverified SSL errors.
logger = logging.getLogger(__name__)
@ -31,7 +32,7 @@ logging.captureWarnings(True)
setup_web = Blueprint('setup_web', __name__, template_folder='templates')
STATUS_TAGS = app.config['STATUS_TAGS']
# STATUS_TAGS = app.config['STATUS_TAGS']
@setup_web.route('/', methods=['GET'], defaults={'path': ''})
@no_cache