Creating admin interface

This commit is contained in:
James Pattinson
2025-10-21 20:23:58 +00:00
parent f580d0fbf7
commit 28af669993
6 changed files with 1276 additions and 19 deletions

14
backend/app/core/utils.py Normal file
View File

@@ -0,0 +1,14 @@
from fastapi import Request
def get_client_ip(request: Request) -> str:
"""Extract client IP address from request"""
forwarded = request.headers.get("X-Forwarded-For")
if forwarded:
return forwarded.split(",")[0].strip()
real_ip = request.headers.get("X-Real-IP")
if real_ip:
return real_ip
return request.client.host if request.client else "127.0.0.1"