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

53
manage.py Normal file
View File

@@ -0,0 +1,53 @@
import os
import sys
import click
from logzero import logger
from hyperglass import render as render
from hyperglass import hyperglass
@click.group()
def main():
pass
@main.command()
def clearcache():
try:
hyperglass.clearCache()
logger.info("Successfully cleared cache.")
except:
raise
logger.error("Failed to clear cache.")
@main.command()
def testserver():
try:
render.css.renderTemplate()
hyperglass.app.run(host="0.0.0.0", debug=True, port=5000)
logger.error("Started test server.")
except:
logger.error("Failed to start test server.")
raise
if __name__ == "__main__":
main()
# for arg in sys.argv:
# if arg == "clearcache":
# try:
# hyperglass.hyperglass.app.clearcache()
# logger.info("Successfully cleared cache.")
# except:
# raise
# logger.error("Failed to clear cache.")
# elif arg == "test":
# try:
# render.css.renderTemplate()
# app.run(host="0.0.0.0", debug=True, port=5000)
# logger.error("Started test server.")
# except:
# logger.error("Failed to start test server.")
# raise