[Modify] Add access log

pull/828/merge
ibuler 7 years ago
parent e0a3fafbd5
commit 6586bef84c

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

Loading…
Cancel
Save