From: David ‘Bombe’ Roden Date: Wed, 8 May 2013 23:06:38 +0000 (+0200) Subject: Add skeletons for views. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=317c323f64b4435d65e4267ef70f01cc16f3e33f;p=demoscenemusic.git Add skeletons for views. --- 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 %}