i am working on an django App
On my html page " results.html " i want to add a button to download the page to pdf
How is it possible, please ? What i have to write in the fonction" download_pdf" in the file views.py?
.html :
<a class="btn btn-primary" href="{% url 'download_pdf' %}" role="button">Download pdf</a>
urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.home),
path('views.download_my_pdf', views.download_pdf, name="download_pdf"),
]
views.py :
def download_pdf(request):
return response