trcbk-devmode-only

This commit is contained in:
2022-12-03 10:37:45 +03:00
parent e4bbe11bed
commit 70501d49b0
2 changed files with 22 additions and 15 deletions

View File

@@ -4,6 +4,11 @@ import uvicorn
from settings import PORT, DEV_SERVER_STATUS_FILE_NAME
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
print("%s: %s" % (exception_type.__name__, exception))
log_settings = {
'version': 1,
'disable_existing_loggers': True,
@@ -66,7 +71,6 @@ if __name__ == "__main__":
if x == "dev":
if os.path.exists(DEV_SERVER_STATUS_FILE_NAME):
os.remove(DEV_SERVER_STATUS_FILE_NAME)
want_reload = False
if "reload" in sys.argv:
print("MODE: DEV + RELOAD")
@@ -90,6 +94,7 @@ if __name__ == "__main__":
migrate()
else:
sys.excepthook = exception_handler
uvicorn.run(
"main:app",
host="0.0.0.0",