From 317c323f64b4435d65e4267ef70f01cc16f3e33f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 9 May 2013 01:06:38 +0200 Subject: [PATCH] Add skeletons for views. --- data/views.py | 13 ++++++++++++- templates/base.html | 11 +++++++++++ templates/home.html | 17 +++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 templates/base.html create mode 100644 templates/home.html diff --git a/data/views.py b/data/views.py index 60f00ef..1ca48df 100644 --- a/data/views.py +++ b/data/views.py @@ -1 +1,12 @@ -# Create your views here. +# encoding: utf-8 +from django.shortcuts import render_to_response +from django.http import HttpResponse + +from DemosceneMusic.data.models import Track + +def home(request): + tracks = Track.objects.all() + return render_to_response('templates/home.html', { 'tracks': tracks }) + +def track(request, trackId): + return HttpResponse('Track: %s' % trackId) diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..cb6e80a --- /dev/null +++ b/templates/base.html @@ -0,0 +1,11 @@ + + + {% block title %} – Demoscene Music{% endblock %} + + + {% block content %}{% endblock %} + + + diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..d9378ad --- /dev/null +++ b/templates/home.html @@ -0,0 +1,17 @@ +{% extends "templates/base.html" %} + +{% block title %}Home{{ block.super }}{% endblock %} + +{% block content %} + +

Tracks

+ +{% for track in tracks %} + +
+ {{ track }} +
+ +{% endfor %} + +{% endblock content %} -- 2.7.4