You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ccvpn/ccvpn/context_processors.py

15 lines
446 B
Python

8 years ago
from django.conf import settings
from ccvpn.common import get_client_ip
from lambdainst.core import is_vpn_gateway
8 years ago
def some_settings(request):
client_ip = get_client_ip(request)
8 years ago
return {
'CLIENT_IP': client_ip,
'CLIENT_ON_VPN': is_vpn_gateway(client_ip),
8 years ago
'ROOT_URL': settings.ROOT_URL,
'ADDITIONAL_HTML': settings.ADDITIONAL_HTML,
'ADDITIONAL_HEADER_HTML': settings.ADDITIONAL_HEADER_HTML,
}