[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")), ('Storage', _("Storage")),
) )
ENV_CHOICES = ( ENV_CHOICES = (
('Prod', 'Production'), ('Prod', _('Production')),
('Dev', 'Development'), ('Dev', _('Development')),
('Test', 'Testing'), ('Test', _('Testing')),
) )
# Important # 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") @receiver(post_init, sender=Cluster, dispatch_uid="my_unique_identifier")
def on_cluster_init(sender, instance, **kwargs): def on_cluster_init(sender, instance, **kwargs):
logger.debug("On cluster init")
instance.__original_assets = tuple(instance.assets.values_list('pk', flat=True)) instance.__original_assets = tuple(instance.assets.values_list('pk', flat=True))
# instance.__origin_system_users = tuple(instance.systemuser_set.all()) # instance.__origin_system_users = tuple(instance.systemuser_set.all())

@ -44,8 +44,8 @@ class AssetListView(AdminUserRequiredMixin, TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = { context = {
'app': 'Assets', 'app': _('Assets'),
'action': 'Asset list', 'action': _('Asset list'),
# 'groups': AssetGroup.objects.all(), # 'groups': AssetGroup.objects.all(),
'system_users': SystemUser.objects.all(), 'system_users': SystemUser.objects.all(),
} }
@ -58,8 +58,8 @@ class UserAssetListView(LoginRequiredMixin, TemplateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = { context = {
'app': 'Assets', 'app': _('Assets'),
'action': 'Asset list', 'action': _('Asset list'),
'system_users': SystemUser.objects.all(), 'system_users': SystemUser.objects.all(),
} }
kwargs.update(context) kwargs.update(context)

@ -51,7 +51,12 @@ def start_gunicorn():
make_migrations() make_migrations()
collect_static() collect_static()
os.chdir(APPS_DIR) 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: if DEBUG:
cmd += " --reload" cmd += " --reload"
p = subprocess.Popen(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr) p = subprocess.Popen(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)

Loading…
Cancel
Save