调试代码

main
RogerWork 8 months ago
parent 25318f1477
commit a175c332d1
  1. 1
      dingxin_toolbox_drf/http.py
  2. 2
      dingxin_toolbox_drf/settings.py

@ -8,6 +8,7 @@ class SetRemoteAddrFromForwardedFor(MiddlewareMixin):
"""
def process_request(self, request):
print('process_request')
try:
real_ip = request.META['HTTP_X_FORWARDED_FOR']
print("request.META")

@ -88,10 +88,10 @@ MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'dingxin_toolbox_drf.http.SetRemoteAddrFromForwardedFor',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'dingxin_toolbox_drf.http.SetRemoteAddrFromForwardedFor',
]
ROOT_URLCONF = 'dingxin_toolbox_drf.urls'

Loading…
Cancel
Save