summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'python/bb_dashboard/www/views.py')
-rw-r--r--python/bb_dashboard/www/views.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/bb_dashboard/www/views.py b/python/bb_dashboard/www/views.py
new file mode 100644
index 0000000..05dcd10
--- /dev/null
+++ b/python/bb_dashboard/www/views.py
@@ -0,0 +1,16 @@
+# Copyright 1998-2019 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from django.http import HttpResponse
+from django.shortcuts import render
+from django.conf import settings
+
+from .utils import default_siteinfo
+from .models import Posts
+
+def index(request):
+ menyrequest = 'www'
+ siteinfo = default_siteinfo(request, menyrequest)
+ siteinfo['posts'] = Posts.objects.all()[:2]
+ htmlrequest = menyrequest + '/index.html'
+ return render(request, htmlrequest, siteinfo)