text: Q:
  
  web page is downloaded instead of being rendered in safari
  
  As the title suggests, when visit my website on safari, web pages are downloaded instead of being rendered normally. Its fine on chrome and firefox. I suspect that the cause of this is redirect because it was working on safari when there was no redirect. /admin works fine in safari. Please help.
  in root/urls.py
  urlpatterns = patterns(
      '',
      url(r'^admin/', include(admin.site.urls)),
      url(r'^$', RedirectView.as_view(url='/albums/latest/', permanent=True)),
      url(r'^albums/', include('photography.urls')),
  )
  
  in app/urls.py
  urlpatterns = patterns(
      'photography.views',
  
      url(r'^latest/$', views.latest_album),
      url(r'^(?P<slug>[a-zA-Z0-9-]+)/$', views.photos_by_location,
      name='photos_by_location'),
  
      )
  
  and in views.py
  def latest_album(request):
      context = RequestContext(request)
      try:
          latest_album = Album.objects.latest('id')
      except Album.DoesNotExist:
          raise Http404("Didnt find any Album matches the query.")
      photos = get_list_or_404(Photo, album=latest_album)
      context_dict = {}
      context_dict['album'] = latest_album
      context_dict['photos'] = photos
  
      return TemplateResponse(request, 'photography/photos_by_location.html',
                          context_dict, context)
  
  some more info about my server:
  HTTP/1.1 301 MOVED PERMANENTLY
  Connection: keep-alive
  Content-Type: text/html; charset=utf-8
  Date: Thu, 03 Sep 2015 22:58:36 GMT
  Location: http://joyceful.com/albums/latest/
  P3P: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"
  Server: nginx/1.4.6 (Ubuntu)
  Transfer-Encoding: chunked
  X-Frame-Options: SAMEORIGIN
  
  A:
  
  changing TemplateResponse to render_to_response fixed the problem. not sure why though.
  
  