我在使用python/django创建指向目录中pdf文档的链接时遇到问题。html页面中的链接如下所示:
<a href="pilots/12-and-Holding.pdf" target="_blank" Read Me</a>
这是一个pdf,我想在另一个页面上打开,可以下载。它设置的折叠是pilots/12-and-Holding.pdf
我哪里做错了?我得到的错误是:
Using the URLconf defined in scripts.urls, Django tried these URL patterns, in this order:
The current path, pilots/12-and-Holding.pdf, didn't match any of these.
这需要url路径吗
谢谢
托尼
@furas已经解释过了
我假设您在
static
文件夹下有一个文件夹pilots
,它保存您的文件12-and-Holding.pdf
然后,在模板中,您只需要:
确保模板顶部有
{% load static %}
相关问题 更多 >
编程相关推荐