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 path
s.
👤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>
- [Answered ]-Django-notifications won't sync
- [Answered ]-Complex query in django
- [Answered ]-How can I implement adding multiple objects with Django form?
- [Answered ]-Django Tastypie Generic Relation
Source:stackexchange.com