gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
14
core/middlewares/logging_middleware.py
Executable file
14
core/middlewares/logging_middleware.py
Executable file
@@ -0,0 +1,14 @@
|
||||
class LoggingMiddleware:
|
||||
def __init__(self, get_response):
|
||||
self.get_response = get_response
|
||||
|
||||
def __call__(self, request):
|
||||
print(
|
||||
f"Request: {request.method} {request.path} from {request.META['REMOTE_ADDR']}"
|
||||
)
|
||||
|
||||
response = self.get_response(request)
|
||||
|
||||
print(f"Response: {response.status_code}")
|
||||
|
||||
return response
|
||||
Reference in New Issue
Block a user