【发布时间】:2019-08-23 08:07:54
【问题描述】:
我的文件目录是:
site
-search
-factfinder
-pdf_reports
test.pdf
在我的 base.html 文件中,我有:
<a class="linkbtn" href='/factfinder/pdf_reports/{{ab.0.file_name}}.pdf' >open pdf</a>
但是在点击链接时,我被重定向到http://localhost:8000/factfinder/pdf_reports/test.pdf,并且我收到一个错误提示页面未找到。
我还得到以下错误的详细信息:
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
admin/
elasticsearch_results/ [name='elasticsearch_results']
pdf_open [name='pdf_open']
pdf_open_2 [name='pdf_open_2']
rating [name='rating']
parse_pdf [name='parse_pdf']
filters [name='filters']
run_model [name='run_model']
The current path, factfinder/pdf_reports/test.pdf, didn't match any of these.
【问题讨论】:
-
文件目录是什么意思?你的意思是 media 目录吗?为什么 factfinder 目录之前没有搜索目录?