title: Django admin page adding save as pdf button
body: <p>In the below code I have added a save as pdf button in admin page by customizing it. While I'm clicking the save as pdf button it should display the details of the current page in pdf format. I'm not able to retrieve the separate data of the current page to display it in the pdf form (<code>my_template.html</code>). How to do it? Thanks in advance.</p>
  
  <p><code>views.py</code>:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  # Create your views here.
  from django.http import HttpResponse
  from django.views.generic import View
  from django.db import models
  from details.utils import render_to_pdf #created in step 4
  from .models import UserDetails
  
  class GeneratePdf(View): 
      def get(self, request, *args, **kwargs):
        #THIS IS THE PLACE WHERE I GET STUCK
        all = {
            "Name": "obj.name",
            "Email": "obj.email",
            "Address": "obj.address",
            "DOB": "obj.dob",
            "Gender": "obj.gender",
        } 
        pdf = render_to_pdf('my_template.html', all)
        return HttpResponse(pdf, content_type='application/pdf')
  </code></pre>
  
  <p><code>urls.py</code>:</p>
  
  <pre><code>"""myapp URL Configuration
  
  The `urlpatterns` list routes URLs to views. For more information please see:
      https://docs.djangoproject.com/en/1.11/topics/http/urls/
  Examples:
  Function views
      1. Add an import:  from my_app import views
      2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
  Class-based views
      1. Add an import:  from other_app.views import Home
      2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
  Including another URLconf
      1. Import the include() function: from django.conf.urls import url, include
      2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
  """
  from django.conf.urls import url
  from django.contrib import admin
  
  from details.views import GeneratePdf
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^pdf/$', GeneratePdf.as_view(),name='generatepdf'),
  ]
  </code></pre>