2019-01-29 22:06:32 +00:00
|
|
|
from django.shortcuts import render
|
2019-01-27 13:26:29 +00:00
|
|
|
from django.http import HttpResponse
|
|
|
|
|
|
|
|
|
|
|
|
def index(request):
|
2019-01-27 14:34:50 +00:00
|
|
|
back_to_url = ""
|
|
|
|
if "back_to" in request.GET:
|
|
|
|
back_to_url = request.GET["back_to"]
|
2019-01-27 15:39:55 +00:00
|
|
|
elif 'HTTP_HOST' in request.META:
|
|
|
|
back_to_url = request.META['HTTP_HOST']
|
2019-01-29 22:06:32 +00:00
|
|
|
context = {
|
|
|
|
'domain': back_to_url
|
|
|
|
}
|
|
|
|
|
2019-01-27 14:34:50 +00:00
|
|
|
if back_to_url != "":
|
2019-01-29 22:06:32 +00:00
|
|
|
return render(request, 'index.html', context)
|
2019-01-27 14:34:50 +00:00
|
|
|
else:
|
|
|
|
return HttpResponse(
|
2019-01-29 22:06:32 +00:00
|
|
|
"""Sorry, this part ofAAAAAAAAAAAAAAAAAa domain is not reachable by IPv4.
|
2019-01-27 14:34:50 +00:00
|
|
|
Please upgrade to IPv6 and try to reach the domain again."""
|
2019-01-27 13:26:29 +00:00
|
|
|
)
|