From ad5e88f1e33005cbfb4c7036a587e27098f0dc18 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 31 Jul 2024 15:01:33 +0800 Subject: [PATCH] perf: display migrate log --- apps/jumpserver/settings/base.py | 6 +++--- jms | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/jumpserver/settings/base.py b/apps/jumpserver/settings/base.py index c79f17222..30b73c71d 100644 --- a/apps/jumpserver/settings/base.py +++ b/apps/jumpserver/settings/base.py @@ -83,9 +83,9 @@ if DEBUG: DEBUG_HOST_PORTS = ['{}:{}'.format(host, port) for host in DEBUG_HOSTS for port in DEBUG_PORT] ALLOWED_DOMAINS.extend(DEBUG_HOST_PORTS) -print("ALLOWED_HOSTS: ", ) -for host in ALLOWED_DOMAINS: - print(' - ' + host.lstrip('.')) +# print("ALLOWED_HOSTS: ", ) +# for host in ALLOWED_DOMAINS: +# print(' - ' + host.lstrip('.')) ALLOWED_HOSTS = ['*'] diff --git a/jms b/jms index 77d002e2c..6797c6d59 100755 --- a/jms +++ b/jms @@ -84,11 +84,12 @@ def expire_caches(): def perform_db_migrate(): logging.info("Check database structure change ...") logging.info("Migrate model change to database ...") + try: management.call_command('migrate') - except Exception: - logging.error('Perform migrate failed, exit', exc_info=True) - sys.exit(11) + except Exception as e: + logging.error('Perform migrate failed') + raise e def collect_static():