From bb9f8a645e68fe3ff676c1c9485b13f747f2665f Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Mon, 27 Oct 2025 12:58:25 +0330 Subject: [PATCH] print ip in user relation api --- apps/authentication/api/v1/api.py | 2 -- apps/authorization/api/v1/api.py | 3 +++ logs/django_requests.log | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/authentication/api/v1/api.py b/apps/authentication/api/v1/api.py index ed2ddc1..b9fbd3e 100644 --- a/apps/authentication/api/v1/api.py +++ b/apps/authentication/api/v1/api.py @@ -160,8 +160,6 @@ class UserViewSet(SoftDeleteMixin, ModelViewSet): serializer = authorize_view.UserRelationSerializer( authorize_view.UserRelations.objects.get(user=request.user) ) - print(request.META.get('HTTP_X_FORWARDED_FOR')) - print(request.META.get('REMOTE_ADDR')) return Response(serializer.data, status.HTTP_200_OK) diff --git a/apps/authorization/api/v1/api.py b/apps/authorization/api/v1/api.py index b3a2419..23c9ee4 100644 --- a/apps/authorization/api/v1/api.py +++ b/apps/authorization/api/v1/api.py @@ -153,4 +153,7 @@ class UserRelationViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet, D return self.get_paginated_response(serializer.data) serializer = self.get_serializer(queryset, many=True) + + print(request.META.get('HTTP_X_FORWARDED_FOR')) + print(request.META.get('REMOTE_ADDR')) return Response(serializer.data) diff --git a/logs/django_requests.log b/logs/django_requests.log index 40bd99b..1b28bfd 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -9,3 +9,5 @@ [2025-10-27 12:47:00,940] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading. [2025-10-27 12:47:03,704] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader [2025-10-27 12:51:33,606] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading. +[2025-10-27 12:51:36,841] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-10-27 12:58:13,543] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading.