diff --git a/.gitignore b/.gitignore index 9e80fa0..7348673 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ local_settings.py .idea/ .cache/ - +*.sqlite diff --git a/nsupdate/main/urls.py b/nsupdate/main/urls.py index 134a217..944d2f8 100644 --- a/nsupdate/main/urls.py +++ b/nsupdate/main/urls.py @@ -1,6 +1,6 @@ from django.conf.urls import patterns, include, url -from django.views.generic import TemplateView +from main.views import HomeView urlpatterns = patterns('', - url(r'^$', TemplateView.as_view(template_name="base.html")), + url(r'^$', HomeView.as_view(), name="home"), ) diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index 60f00ef..d8ec9df 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -1 +1,11 @@ -# Create your views here. +# -*- coding: utf-8 -*- + +from django.views.generic import TemplateView + +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 diff --git a/nsupdate/nsupdate/templates/base.html b/nsupdate/nsupdate/templates/base.html index 8054f10..2140bb8 100644 --- a/nsupdate/nsupdate/templates/base.html +++ b/nsupdate/nsupdate/templates/base.html @@ -22,13 +22,13 @@ - nsupdate.info + nsupdate.info