From 720129335c5ecad82b43b2835929c171ce9e0410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Klein?= Date: Mon, 4 May 2015 18:08:04 +0200 Subject: [PATCH] Fix remote_addr if modoboa django app is powered by apache or nginx proxy --- modoboa/core/commands/templates/settings.py.tpl | 1 + requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index f661f2b71..6354777e1 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -67,6 +67,7 @@ INSTALLED_APPS += MODOBOA_APPS AUTH_USER_MODEL = 'core.User' MIDDLEWARE_CLASSES = ( + 'x_forwarded_for.middleware.XForwardedForMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/requirements.txt b/requirements.txt index 48bb52ba4..8acc68d56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ factory-boy>=2.4 passlib django-versionfield2>=0.3.3 requests +django-xforwardedfor-middleware