Browse Source

perf: 去掉django.po

pull/6932/head
ibuler 3 years ago
parent
commit
b415ee051d
  1. 4
      Dockerfile
  2. 3
      apps/common/apps.py
  3. 11
      jms
  4. 2
      requirements/deb_requirements.txt
  5. 2
      requirements/mac_requirements.txt
  6. 2
      requirements/rpm_requirements.txt

4
Dockerfile

@ -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

3
apps/common/apps.py

@ -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:
if 'migrate' in sys.argv or 'compilemessages' in sys.argv:
return
django_ready.send(CommonConfig)

11
jms

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

2
requirements/deb_requirements.txt

@ -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

2
requirements/mac_requirements.txt

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

2
requirements/rpm_requirements.txt

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

Loading…
Cancel
Save