调试代码

main
RogerWork 8 months ago
parent c4cc36ec3e
commit b8154e5ca8
  1. 3
      dingxin_toolbox_drf/http.py

@ -9,10 +9,11 @@ class SetRemoteAddrFromForwardedFor(MiddlewareMixin):
def process_request(self, request): def process_request(self, request):
print('process_request') print('process_request')
print("request.META")
print(request.META)
try: try:
print("request.META") print("request.META")
real_ip = request.META['HTTP_X_FORWARDED_FOR'] real_ip = request.META['HTTP_X_FORWARDED_FOR']
print(request.META)
print('real_ip', real_ip) print('real_ip', real_ip)
except KeyError as err: except KeyError as err:
print('HTTP_X_FORWARDED_FOR key error') print('HTTP_X_FORWARDED_FOR key error')

Loading…
Cancel
Save