我想生成嵌套的url路徑。到目前爲止,我只能生成1個級別的網址。當我嘗試二級網址時,它不再被調用,它仍然只顯示一級網址,儘管瀏覽器上的地址欄確實指向了二級網址。這是可能的還是我需要創建一個新的應用程序?Django的URL複雜的模式和路徑
urls.py
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView, TemplateView
from dashboard.models import IPARate,PCPRate
from dashboard import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^medicare/', ListView.as_view(queryset=IPARate.objects.all().order_by("id"), template_name='dashboard/medicare.html')),
url(r'^medicare/medicarepcp/$', ListView.as_view(queryset=PCPRate.objects.all().order_by("id"), template_name='dashboard/medicarepcp.html')),
url(r'^medicare/', views.medicaid, name='medicare'),
url(r'^medicare/medicarepcp/$', views.medicarepcp, name='medicarepcp'),
]