24 lines
754 B
Python
Raw Normal View History

2013-09-28 12:06:26 +02:00
# -*- coding: utf-8 -*-
from django.views.generic import TemplateView
from django.http import HttpResponse
import json
2013-09-28 12:06:26 +02:00
class HomeView(TemplateView):
template_name = "base.html"
def get_context_data(self, *args, **kwargs):
context = super(HomeView, self).get_context_data(*args, **kwargs)
context['nav_home'] = True
return context
class OverviewView(TemplateView):
template_name = "overview.html"
def get_context_data(self, *args, **kwargs):
context = super(OverviewView, self).get_context_data(*args, **kwargs)
context['nav_overview'] = True
return context
def MyIpView(request):
2013-09-28 13:14:11 +02:00
return HttpResponse(json.dumps({'ip':request.META['REMOTE_ADDR']}), content_type="application/json")