提交 6586bef8 编写于 作者: baltery's avatar baltery

[Modify] Add access log

上级 e0a3fafb
......@@ -33,9 +33,9 @@ class Asset(models.Model):
('Storage', _("Storage")),
)
ENV_CHOICES = (
('Prod', 'Production'),
('Dev', 'Development'),
('Test', 'Testing'),
('Prod', _('Production')),
('Dev', _('Development')),
('Test', _('Testing')),
)
# Important
......
......@@ -76,7 +76,6 @@ def on_system_user_created_or_updated(sender, instance=None, **kwargs):
@receiver(post_init, sender=Cluster, dispatch_uid="my_unique_identifier")
def on_cluster_init(sender, instance, **kwargs):
logger.debug("On cluster init")
instance.__original_assets = tuple(instance.assets.values_list('pk', flat=True))
# instance.__origin_system_users = tuple(instance.systemuser_set.all())
......
......@@ -44,8 +44,8 @@ class AssetListView(AdminUserRequiredMixin, TemplateView):
def get_context_data(self, **kwargs):
context = {
'app': 'Assets',
'action': 'Asset list',
'app': _('Assets'),
'action': _('Asset list'),
# 'groups': AssetGroup.objects.all(),
'system_users': SystemUser.objects.all(),
}
......@@ -58,8 +58,8 @@ class UserAssetListView(LoginRequiredMixin, TemplateView):
def get_context_data(self, **kwargs):
context = {
'app': 'Assets',
'action': 'Asset list',
'app': _('Assets'),
'action': _('Asset list'),
'system_users': SystemUser.objects.all(),
}
kwargs.update(context)
......
......@@ -51,7 +51,12 @@ def start_gunicorn():
make_migrations()
collect_static()
os.chdir(APPS_DIR)
cmd = "gunicorn jumpserver.wsgi -b {}:{} -w {}".format(HTTP_HOST, HTTP_PORT, WORKERS)
cmd = "gunicorn jumpserver.wsgi -b {}:{} -w {} ".format(
HTTP_HOST, HTTP_PORT, WORKERS
)
log_format = '%(h)s %(t)s "%(r)s" %(s)s %(b)s '
log = " --access-logfile - --access-logformat '{}' ".format(log_format)
cmd += log
if DEBUG:
cmd += " --reload"
p = subprocess.Popen(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册