Quellcode durchsuchen

update tumblr view

mk200789 vor 10 Jahren
Ursprung
Commit
cd978f4a85

+ 14 - 2
hackathon_starter/hackathon/templates/hackathon/tumblr.html

@@ -2,8 +2,20 @@
 <html>
 <body>
 	{% include 'hackathon/base.html' %}
-	<h1> {{ title }} </h1> 
-	{{ blogData }}
+	<div class="col-lg-12">
+		<h1> {{ title }} : User Blog Info </h1> 
+		<br>
+		<div class="table-responsive">
+			<table class="table">
+				{% for i,v in blogData.items %}
+				<tr>
+					<th>{{i}}</th>
+					<td>{{v}}</td>
+				</tr>
+				{% endfor %}
+			</table>
+		</div>
+	</div>
 </body>
 
 </html>

+ 2 - 1
hackathon_starter/hackathon/views.py

@@ -125,7 +125,8 @@ def github(request):
     return render(request, 'hackathon/github.html', { 'data': userData })
 
 def tumblr(request):
-    context = {'title': 'Tumblr Example', 'blogData': tumblrBlogInfo('lingsling')}
+    meta, response, blog = tumblrBlogInfo('david')
+    context = {'title': 'Tumblr Example', 'blogData': blog}
     return render(request, 'hackathon/tumblr.html', context)
 
 def linkedin(request):