﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37107	Request META key `REMOTE_ADDR` not set anywhere in wsgi applications	Rami Boutassghount		"The docs suggest that the `REMOTE_ADDR? is the IP address of the client. See: https://docs.djangoproject.com/en/6.0/ref/request-response/#django.http.HttpRequest.META

However I searched all over the django codebase and that key is not set anywhere in  `HttpRequest` or in its subclass `WSGIRequest`.

The only place where that key is set is in asgi module: https://github.com/django/django/blob/3e4e0db66961a48a080ff3ff91f6c0d954261366/django/core/handlers/asgi.py#L80

I run a small experiment to see what is the value on my test environment and it is always empty, see: 


{{{
    def get_ip_address(self, request) -> str:
        meta = request.META
        remote_addr = meta.get(""REMOTE_ADDR"", """")
        x_forwarded_for = meta.get(""HTTP_X_FORWARDED_FOR"", """")
        x_real_ip = meta.get(""HTTP_X_REAL_IP"", """")
        Bot.to_admin(
            f""IP Address: \n""
            f""HTTP_X_FORWARDED_FOR: {x_forwarded_for}\n""
            f""REMOTE_ADDR: {remote_addr}\n""
            f""HTTP_X_REAL_IP: {x_real_ip}\n""
        )

}}}


Chat in Telegram:

{{{
[5/19/26 10:21 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 198.244.242.58
REMOTE_ADDR: 
HTTP_X_REAL_IP: 198.244.242.58
[5/19/26 10:21 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 2a03:2880:f814:19::
REMOTE_ADDR: 
HTTP_X_REAL_IP: 2a03:2880:f814:19::
[5/19/26 10:21 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 198.244.183.201
REMOTE_ADDR: 
HTTP_X_REAL_IP: 198.244.183.201
[5/19/26 10:22 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 5.39.1.228
REMOTE_ADDR: 
HTTP_X_REAL_IP: 5.39.1.228
[5/19/26 10:22 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 66.249.77.71
REMOTE_ADDR: 
HTTP_X_REAL_IP: 66.249.77.71
[5/19/26 10:22 AM] Rami Bot: IP Address: 
HTTP_X_FORWARDED_FOR: 2606:65c0:20:43d:a16b:57fd:233b:4fe6
REMOTE_ADDR: 
HTTP_X_REAL_IP: 2606:65c0:20:43d:a16b:57fd:233b:4fe6

}}}
"	Uncategorized	new	Core (Other)	6.0	Normal		REMOTE_ADDR, WSGIRequest, HttpRequest, META		Unreviewed	0	0	0	0	0	0
