From 5e57f9270b977c4f132c93a5ee5f07b13a1ecbb8 Mon Sep 17 00:00:00 2001 From: Christopher Charbonneau Wells Date: Tue, 15 Aug 2017 15:14:03 -0400 Subject: [PATCH] Implement a basic front page view. --- babyblotter/urls.py | 1 + core/templates/core/base.html | 10 ++++++++++ core/templates/core/index.html | 5 +++++ core/urls.py | 10 ++++++++++ core/views.py | 8 ++++++++ 5 files changed, 34 insertions(+) create mode 100644 core/templates/core/base.html create mode 100644 core/templates/core/index.html create mode 100644 core/urls.py create mode 100644 core/views.py diff --git a/babyblotter/urls.py b/babyblotter/urls.py index f048260a..808f8cc6 100644 --- a/babyblotter/urls.py +++ b/babyblotter/urls.py @@ -7,4 +7,5 @@ from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'', include('api.urls')), + url(r'', include('core.urls')), ] diff --git a/core/templates/core/base.html b/core/templates/core/base.html new file mode 100644 index 00000000..c925c89b --- /dev/null +++ b/core/templates/core/base.html @@ -0,0 +1,10 @@ + + + + + {% block title %}{% endblock %} | Baby Blotter + + +{% block content %}{% endblock %} + + \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html new file mode 100644 index 00000000..a734bfa5 --- /dev/null +++ b/core/templates/core/index.html @@ -0,0 +1,5 @@ +{% extends 'core/base.html' %} + +{% block title %}Welcome!{% endblock %} + +{% block content %}Welcome!{% endblock %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py new file mode 100644 index 00000000..6804fd04 --- /dev/null +++ b/core/urls.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/core/views.py b/core/views.py new file mode 100644 index 00000000..87be7bd4 --- /dev/null +++ b/core/views.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.views.generic.base import TemplateView + + +class IndexView(TemplateView): + template_name = 'core/index.html'