Merge pull request #6932 from jumpserver/pr@dev@perf_remove_djangopo

perf: 去掉django.po
pull/6967/head
Jiangjie.Bai 2021-09-27 14:12:26 +08:00 committed by GitHub
commit 476e6cdc2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 6 deletions

1
.gitignore vendored
View File

@ -39,4 +39,5 @@ logs/*
.vagrant/
release/*
releashe
django.mo
/apps/script.py

View File

@ -35,12 +35,14 @@ RUN mkdir -p /root/.ssh/ \
&& echo "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile /dev/null" > /root/.ssh/config
RUN mkdir -p /opt/jumpserver/oracle/ \
&& wget https://download.jumpserver.org/public/instantclient-basiclite-linux.x64-21.1.0.0.0.tar \
&& wget https://download.jumpserver.org/public/instantclient-basiclite-linux.x64-21.1.0.0.0.tar > /dev/null \
&& tar xf instantclient-basiclite-linux.x64-21.1.0.0.0.tar -C /opt/jumpserver/oracle/ \
&& echo "/opt/jumpserver/oracle/instantclient_21_1" > /etc/ld.so.conf.d/oracle-instantclient.conf \
&& ldconfig \
&& rm -f instantclient-basiclite-linux.x64-21.1.0.0.0.tar
RUN cd apps && python manage.py compilemessages
RUN echo > config.yml
VOLUME /opt/jumpserver/data
VOLUME /opt/jumpserver/logs

View File

@ -10,5 +10,6 @@ class CommonConfig(AppConfig):
def ready(self):
from . import signals_handlers
from .signals import django_ready
if 'migrate' not in sys.argv:
django_ready.send(CommonConfig)
if 'migrate' in sys.argv or 'compilemessages' in sys.argv:
return
django_ready.send(CommonConfig)

Binary file not shown.

11
jms
View File

@ -100,9 +100,20 @@ def collect_static():
logging.info("Collect static files done")
def compile_i81n_file():
django_mo_file = os.path.join(BASE_DIR, 'apps', 'locale', 'zh', 'LC_MESSAGES', 'django.mo')
if os.path.exists(django_mo_file):
return
os.chdir(os.path.join(BASE_DIR, 'apps'))
_cmd = 'python3 manage.py compilemessages --no-input -c &> /dev/null '
subprocess.call(_cmd, shell=True)
logging.info("Compile i18n files done")
def upgrade_db():
collect_static()
perform_db_migrate()
collect_static()
def prepare():

View File

@ -1 +1 @@
g++ make iputils-ping default-libmysqlclient-dev libpq-dev libffi-dev libldap2-dev libsasl2-dev sshpass
g++ make iputils-ping default-libmysqlclient-dev libpq-dev libffi-dev libldap2-dev libsasl2-dev sshpass gettext

View File

@ -1 +1 @@
brew install libtiff libjpeg webp little-cms2 openssl
brew install libtiff libjpeg webp little-cms2 openssl gettext

View File

@ -1 +1 @@
gcc-c++ sshpass mariadb-devel openldap-devel
gcc-c++ sshpass mariadb-devel openldap-devel gettext