fnp
/
prawokultury.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
allow editing date
[prawokultury.git]
/
realip_middleware.py
1
class SetRemoteAddrFromXRealIP(object):
2
"""Sets REMOTE_ADDR from the X-Real-IP header, as set by Nginx."""
3
def process_request(self, request):
4
try:
5
request.META['REMOTE_ADDR'] = request.META['HTTP_X_REAL_IP']
6
except KeyError:
7
return None