[Answered ]-How do you change the title of a pdf using django?

1👍

Your browser is showing the last segment of the URL in the absence of any other title. Just change your URL to

path("show_file/<file_id>", v.show_file, name="show_file"),

What you have now seems to be a half-baked porting of a regexp-based re_path to the <>-based paths.

👤AKX

0👍

You just have to include the file title in the URL like so, but first pass it from your template.

urls.py

    urlpatterns = [
     path("show_file/<file_id>/<file_title>",v.show_file, name="show_file" ),
            ]

 

like:

    <a href=
    "{% url 'show_file' file_id=file.id file_title=file.title %}"
    class="text-right">View</a>

Leave a comment