Browse Source

Passing parsed user data into view, updating template

David Leonard 10 years ago
parent
commit
fa766a03d2

+ 3 - 1
hackathon_starter/hackathon/templates/hackathon/github.html

@@ -2,6 +2,8 @@
 <html>
 <body>
 	{% include 'hackathon/base.html' %}
-	<h1> {{ title }} </h1> 
+	{% for key in data %}
+		{{ key }}
+	{% endfor %}
 </body>
 </html>

+ 2 - 4
hackathon_starter/hackathon/views.py

@@ -117,8 +117,6 @@ def steam(request):
     return render(request,'hackathon/steam.html', {"game": game })
 
 def github(request):
-    data = getUserData()
-    print data
-    context = {'title': 'Github Example'}
-    return render(request, 'hackathon/github.html', context)
+    userData = getUserData()
+    return render(request, 'hackathon/github.html', { 'data': userData })