ungleich-no-ipv4-here/no_ipv4_here/views.py

22 lines
621 B
Python

from django.shortcuts import render
from django.http import HttpResponse
def index(request):
back_to_url = ""
if "back_to" in request.GET:
back_to_url = request.GET["back_to"]
elif 'HTTP_HOST' in request.META:
back_to_url = request.META['HTTP_HOST']
context = {
'domain': back_to_url
}
if back_to_url != "":
return render(request, 'index.html', context)
else:
return HttpResponse(
"""Sorry, this part ofAAAAAAAAAAAAAAAAAa domain is not reachable by IPv4.
Please upgrade to IPv6 and try to reach the domain again."""
)