small fix in logging and supporting both granian/gunicorn

This commit is contained in:
badblocks 2025-04-29 12:10:34 -07:00
parent 8d316f07ce
commit 411c274e56
2 changed files with 2 additions and 1 deletions

View file

@ -14,5 +14,5 @@ class LogRequestsMiddleware:
return response return response
def log(self, request, response, start, end): def log(self, request, response, start, end):
logging.info(f"{request.method} {request.path_info} -> {response.status_code}, took {end - start}s") logging.info(f"{request.method} {request.path_info} -> RESP {response.status_code}, took {end - start}s")

View file

@ -6,3 +6,4 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_project.settings")
# use app for granian, application for gunicorn # use app for granian, application for gunicorn
app = get_wsgi_application() app = get_wsgi_application()
application = app