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

17 lines
555 B
Python

from django.conf import settings
from ccvpn.common import get_client_ip
from django_lcore 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,
'SUPPORT_TEMPLATE': settings.SUPPORT_TEMPLATE,
'ADDITIONAL_HEADER_HTML': settings.ADDITIONAL_HEADER_HTML,
'HCAPTCHA_SITE_KEY': settings.HCAPTCHA_SITE_KEY,
}