Commit 23d35df3 authored by fred's avatar fred

add internal_ip context processor

parent 30db5429
from django.conf import settings
def internal_ip(request):
internal_ip = self.request.META.get('HTTP_X_FORWARDED_FOR') or \
self.request.META.get('HTTP_X_REAL_IP') or \
self.request.META.get('REMOTE_ADDR')
return internal_ip in settings.INTERNAL_IPS
......@@ -2,6 +2,7 @@
# coding: utf-8
import os
from django.conf import global_settings
DEBUG = True
TEMPLATE_DEBUG = DEBUG
......@@ -236,6 +237,10 @@ PIGE_DOWNLOAD_BASE_URL = 'http://pige.panik/extractor/download.cgi'
JSON_CELL_TYPES = {}
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + \
('panikdb.context_processors.internal_ip',)
try:
from local_settings import *
except ImportError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment