Merge soutade.fr:dynastie

This commit is contained in:
Grégory Soutadé 2012-10-20 21:02:37 +02:00
commit 6aedd6f910
1 changed files with 3 additions and 3 deletions

View File

@ -533,9 +533,9 @@ def add_comment(request, post_id, parent_id):
print 'Error on author or the_comment'
return HttpResponseRedirect(ref)
# Behind a proxy
if 'X-Real-IP' in request.META:
ip = request.META['X-Real-IP']
# Behind nginx proxy
if 'HTTP_X_FORWARDED_FOR' in request.META:
ip = request.META['HTTP_X_FORWARDED_FOR']
else:
ip = request.META['REMOTE_ADDR']