perf: display migrate log

pull/13852/head
ibuler 2024-07-31 15:01:33 +08:00 committed by Bryan
parent b1e958d806
commit ad5e88f1e3
2 changed files with 7 additions and 6 deletions

View File

@ -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 = ['*']

7
jms
View File

@ -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():