15 lines
504 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.conf import settings
from main.forms import *
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")