diff --git a/nsupdate/main/urls.py b/nsupdate/main/urls.py index d50c085..2222b69 100644 --- a/nsupdate/main/urls.py +++ b/nsupdate/main/urls.py @@ -1,7 +1,8 @@ from django.conf.urls import patterns, include, url -from main.views import HomeView, MyIpView +from main.views import HomeView, MyIpView, OverviewView urlpatterns = patterns('', url(r'^$', HomeView.as_view(), name="home"), + url(r'^overview/', OverviewView.as_view(), name="overview"), url(r'^myip/', MyIpView) ) diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index eb36792..24b02bd 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -11,5 +11,14 @@ class HomeView(TemplateView): 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): return HttpResponse(json.dumps({'ip':request.META['REMOTE_ADDR']}), content_type="application/json") \ No newline at end of file diff --git a/nsupdate/nsupdate/templates/base.html b/nsupdate/nsupdate/templates/base.html index 2140bb8..4e10175 100644 --- a/nsupdate/nsupdate/templates/base.html +++ b/nsupdate/nsupdate/templates/base.html @@ -11,6 +11,7 @@ +
@@ -27,6 +28,7 @@