Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
8b081cd6
Commit
8b081cd6
authored
Dec 24, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改 运行脚本
parent
209200dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
20 deletions
+4
-20
settings.py
apps/jumpserver/settings.py
+3
-3
run_server.py
run_server.py
+1
-17
No files found.
apps/jumpserver/settings.py
View file @
8b081cd6
...
@@ -242,8 +242,8 @@ LOGGING = {
...
@@ -242,8 +242,8 @@ LOGGING = {
# https://docs.djangoproject.com/en/1.10/topics/i18n/
# https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE
=
'en-us'
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'UTC'
#
TIME_ZONE = 'UTC'
#
TIME_ZONE = 'Asia/Shanghai'
TIME_ZONE
=
'Asia/Shanghai'
USE_I18N
=
True
USE_I18N
=
True
...
@@ -338,7 +338,7 @@ CELERY_RESULT_EXPIRES = 3600
...
@@ -338,7 +338,7 @@ CELERY_RESULT_EXPIRES = 3600
CELERY_WORKER_LOG_FORMAT
=
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
CELERY_WORKER_LOG_FORMAT
=
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
CELERY_WORKER_TASK_LOG_FORMAT
=
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
CELERY_WORKER_TASK_LOG_FORMAT
=
'
%(asctime)
s [
%(module)
s
%(levelname)
s]
%(message)
s'
CELERY_TASK_EAGER_PROPAGATES
=
True
CELERY_TASK_EAGER_PROPAGATES
=
True
CELERY_TIMEZONE
=
TIME_ZONE
#
CELERY_TIMEZONE = TIME_ZONE
# CELERY_ENABLE_UTC = True
# CELERY_ENABLE_UTC = True
...
...
run_server.py
View file @
8b081cd6
...
@@ -34,7 +34,7 @@ def start_gunicorn():
...
@@ -34,7 +34,7 @@ def start_gunicorn():
def
start_celery
():
def
start_celery
():
print
(
"- Start Celery as Distributed Task Queue"
)
print
(
"- Start Celery as Distributed Task Queue"
)
os
.
chdir
(
APPS_DIR
)
os
.
chdir
(
APPS_DIR
)
# Todo: Must set this environment,
if
not no ansible result return
# Todo: Must set this environment,
otherwise
not no ansible result return
os
.
environ
.
setdefault
(
'PYTHONOPTIMIZE'
,
'1'
)
os
.
environ
.
setdefault
(
'PYTHONOPTIMIZE'
,
'1'
)
cmd
=
'celery -A common worker -l {}'
.
format
(
LOG_LEVEL
.
lower
())
cmd
=
'celery -A common worker -l {}'
.
format
(
LOG_LEVEL
.
lower
())
subprocess
.
call
(
cmd
,
shell
=
True
)
subprocess
.
call
(
cmd
,
shell
=
True
)
...
@@ -55,24 +55,8 @@ def make_migrations():
...
@@ -55,24 +55,8 @@ def make_migrations():
subprocess
.
call
(
'bash make_migrations.sh'
,
shell
=
True
)
subprocess
.
call
(
'bash make_migrations.sh'
,
shell
=
True
)
def
load_init_data
():
print
(
"Load init data, if need"
)
os
.
chdir
(
APPS_DIR
)
print
(
os
.
listdir
(
APPS_DIR
))
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'jumpserver.settings'
from
users.models
import
User
was_initial
=
User
.
objects
.
all
()
.
count
()
if
not
was_initial
:
os
.
chdir
(
os
.
path
.
join
(
BASE_DIR
,
'utils'
))
subprocess
.
call
(
'bash init_db.sh'
,
shell
=
True
)
else
:
print
(
"Has been initial, pass"
)
def
main
():
def
main
():
make_migrations
()
make_migrations
()
load_init_data
()
print
(
time
.
ctime
())
print
(
time
.
ctime
())
print
(
'Jumpserver version {}, more see https://www.jumpserver.org'
.
format
(
print
(
'Jumpserver version {}, more see https://www.jumpserver.org'
.
format
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment