我正在使用django并尝试将我的一个链接链接到导航栏中的html文件。我将所有的html文件存储在一个名为personal的文件夹中,并存放在个人名为includes的子文件夹中。我正在尝试将我的注册链接链接到Register.html文件,但它总是说它无法找到它并且当前网址Register.html不是可识别的网址格式。这是我在我的home.html文件中引用它的方式,这是我的导航栏所在的位置:
<li class="active"><a href="/Register.html">Register <span class="sr-only">(current)</span></a></li>
我的urls.py文件如下所示:
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$',include('personal.urls'))]
我在这个网站上找到了答案,但我似乎无法找到答案。我试过操纵我的views.py文件和我的urls.py文件,但他们最终使webapp根本不起作用。我的问题是如何解决错误,以便它识别那些HTML文件?