1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

gunicorn fixed, improved manage.py

This commit is contained in:
checktheroads
2019-05-12 19:22:17 -07:00
parent 9a4a8cf65e
commit ddc7f1238e
27 changed files with 76 additions and 23 deletions

View File

@@ -9,9 +9,9 @@ from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
# Local Imports
from hyperglass import render
from hyperglass import configuration
import hyperglass.configuration as configuration
from hyperglass.command import execute
from hyperglass import render
# Load TOML config file
devices = configuration.devices()
@@ -27,6 +27,14 @@ rate_limit_query = configuration.gen.rate_limit_query() + " per minute"
rate_limit_site = configuration.gen.rate_limit_site() + "per minute"
limiter = Limiter(app, key_func=get_remote_address, default_limits=[rate_limit_site])
def renderCSS():
try:
render.css.renderTemplate()
except:
raise
# Render Main Flask-Limiter Error Message
@app.errorhandler(429)
def error429(e):