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

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