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] DEBUG_HOST_PORTS = ['{}:{}'.format(host, port) for host in DEBUG_HOSTS for port in DEBUG_PORT]
ALLOWED_DOMAINS.extend(DEBUG_HOST_PORTS) ALLOWED_DOMAINS.extend(DEBUG_HOST_PORTS)
print("ALLOWED_HOSTS: ", ) # print("ALLOWED_HOSTS: ", )
for host in ALLOWED_DOMAINS: # for host in ALLOWED_DOMAINS:
print(' - ' + host.lstrip('.')) # print(' - ' + host.lstrip('.'))
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']

7
jms
View File

@ -84,11 +84,12 @@ def expire_caches():
def perform_db_migrate(): def perform_db_migrate():
logging.info("Check database structure change ...") logging.info("Check database structure change ...")
logging.info("Migrate model change to database ...") logging.info("Migrate model change to database ...")
try: try:
management.call_command('migrate') management.call_command('migrate')
except Exception: except Exception as e:
logging.error('Perform migrate failed, exit', exc_info=True) logging.error('Perform migrate failed')
sys.exit(11) raise e
def collect_static(): def collect_static():