diff podcast/views.py @ 1032:e932f2ecd4a7

Django 1.8 warnings / tech debt cleanup.
author Brian Neal <bgneal@gmail.com>
date Sat, 26 Dec 2015 15:10:55 -0600
parents 89b240fe9297
children aa43db10c565
line wrap: on
line diff
--- a/podcast/views.py	Sun Dec 20 22:18:59 2015 -0600
+++ b/podcast/views.py	Sat Dec 26 15:10:55 2015 -0600
@@ -6,8 +6,7 @@
 import os.path
 from urlparse import urlparse
 
-from django.shortcuts import render_to_response
-from django.template import RequestContext
+from django.shortcuts import render
 from django.shortcuts import get_object_or_404
 
 from podcast.models import Channel
@@ -61,10 +60,9 @@
     except Channel.DoesNotExist:
         channel = None
 
-    return render_to_response('podcast/index.html', {
+    return render(request, 'podcast/index.html', {
         'channel': channel,
-        },
-        context_instance = RequestContext(request))
+        })
 
 
 def detail(request, id):
@@ -78,15 +76,14 @@
     jplayer_media, jplayer_supplied = jplayer_params(ext, podcast.enclosure_url,
               alt_ext, podcast.alt_enclosure_url)
 
-    return render_to_response('podcast/detail.html', {
+    return render(request, 'podcast/detail.html', {
         'channel': podcast.channel,
         'podcast': podcast,
         'ext': ext,
         'alt_ext': alt_ext,
         'jplayer_media': jplayer_media,
         'jplayer_supplied': jplayer_supplied,
-        },
-        context_instance = RequestContext(request))
+        })
 
 
 def feed(request):
@@ -98,7 +95,6 @@
     if channel:
         channel.items = Item.objects.filter(channel=channel)
 
-    return render_to_response('podcast/feed.xml', {
+    return render(request, 'podcast/feed.xml', {
         'channel': channel,
-        },
-        context_instance = RequestContext(request))
+        })