2013-09-28 18:46:31 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.conf import settings
|
2013-09-28 20:01:09 +02:00
|
|
|
from main.forms import *
|
2013-09-28 18:46:31 +02:00
|
|
|
|
|
|
|
def MyIpView(request):
|
2013-09-28 19:01:40 +02:00
|
|
|
return HttpResponse(request.META['REMOTE_ADDR'], content_type="text/plain")
|
|
|
|
|
|
|
|
def UpdateIpView(request):
|
|
|
|
ip = request.META['REMOTE_ADDR']
|
|
|
|
if ':' in ip:
|
|
|
|
request.session['ipv6'] = request.META['REMOTE_ADDR']
|
|
|
|
if '.' in ip:
|
|
|
|
request.session['ipv4'] = request.META['REMOTE_ADDR']
|
|
|
|
return HttpResponse('OK', content_type="text/plain")
|