【发布时间】:2021-03-12 09:19:05
【问题描述】:
我想在 django 中尝试其他应用,但在访问其他应用时遇到问题。
树:
主要:
搜索:
- index.html
- scrape.html
预处理:
- index.html
这样的场景。从 scrape.html 我想在预处理中访问 index.html 但找不到错误路径。我已经在 settings.py 中添加了应用程序
主 url.py
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('search.urls')),
path('preprocessing/', include('preprocessing.urls')),
]
搜索 url.py
urlpatterns = [
path('', views.index,),
path('scrape/',views.scrape,),
]
scrape.html 片段:
<a href = "/preprocessing" button type="button" class="btn btn-primary" target = "blank">Preprocessing</a>
预处理 url.py
path('', views.index),
让我知道我哪里出错了,谢谢你的帮助
【问题讨论】:
-
显示您的模板。此外,如果您在设置中为
APPEND_SLASH设置了值,则会显示。 -
问题可能出在斜杠中,请尝试在调用它的网址末尾添加
/(可能在scrape.html中) -
完成,我已经将我的 scrape.html 切片添加到 /preprocessing 和我的 APPEND_SLASH = False @AbdulAzizBarkat
-
为我的 scrape.html @ErsainD 添加。