mirror of
https://github.com/thecyberlearn/quantumtaskai-caprover.git
synced 2026-08-18 08:52:57 +00:00
- Container and port 3000 are working (simple HTTP server test passed) - Issue is Django-specific routing, not Dokploy - Added debug middleware to log all incoming requests - Added debug_settings.py with enhanced logging and URL pattern display - Updated Dockerfile.dokploy.debug to use debug settings - Added proper ALLOWED_HOSTS with full domain - This will show us exactly which requests Django receives and how it responds
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
"""
|
|
Debug middleware for troubleshooting Dokploy 404 issues
|
|
"""
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
class DebugRequestMiddleware:
|
|
"""Middleware to log all incoming requests for debugging"""
|
|
|
|
def __init__(self, get_response):
|
|
self.get_response = get_response
|
|
|
|
def __call__(self, request):
|
|
# Log incoming request details
|
|
logger.info(f"🌐 INCOMING REQUEST:")
|
|
logger.info(f" - Method: {request.method}")
|
|
logger.info(f" - Path: {request.path}")
|
|
logger.info(f" - Full Path: {request.get_full_path()}")
|
|
logger.info(f" - Host: {request.get_host()}")
|
|
logger.info(f" - User Agent: {request.META.get('HTTP_USER_AGENT', 'Unknown')[:100]}")
|
|
logger.info(f" - Remote IP: {request.META.get('REMOTE_ADDR', 'Unknown')}")
|
|
logger.info(f" - Headers: {dict(request.headers)}")
|
|
|
|
# Process request
|
|
response = self.get_response(request)
|
|
|
|
# Log response
|
|
logger.info(f"📤 RESPONSE:")
|
|
logger.info(f" - Status Code: {response.status_code}")
|
|
logger.info(f" - Content Type: {response.get('Content-Type', 'Unknown')}")
|
|
|
|
return response
|