-# 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)
--- /dev/null
+<html>
+ <head>
+ <title>{% block title %} – Demoscene Music{% endblock %}</title>
+ </head>
+ <body>
+ {% block content %}{% endblock %}
+ <div id="footer" align="center">
+ demoscenemusic.org - © 2013 David ‘Bombe’ Roden
+ </div>
+ </body>
+</html>
--- /dev/null
+{% extends "templates/base.html" %}
+
+{% block title %}Home{{ block.super }}{% endblock %}
+
+{% block content %}
+
+<h1>Tracks</h1>
+
+{% for track in tracks %}
+
+ <div class="track">
+ <span class="name"><a href="/track/{{ track.id }}/">{{ track }}</a></span>
+ </div>
+
+{% endfor %}
+
+{% endblock content %}