我希望從我的儀表板頁面瀏覽鏈接時,該網址應該是/dashboard/link
。 當我寫url(r'dashboard/inbox/','apps.dashboard.views.inbox', name = 'grabhalo_inbox'),
它確實讀取我提供的views
參數。Django的urls.py查詢
而是當我寫url(r'inbox/','apps.dashboard.views.inbox', name = 'grabhalo_inbox'),
時,我得到預期的輸出,但URL是/inbox
。我想要的是/dashboard/inbox
。
我哪裏錯了?
這裏是我的根urls.py文件
這裏是我的dashboard.urls.py
urlpatterns = patterns('',
url(r'dashboard/','apps.dashboard.views.dashboard', name = 'grabhalo_dashboard'),
url(r'sent/','apps.dashboard.views.sent', name = 'grabhalo_sent'),
url(r'inbox/','apps.dashboard.views.inbox', name = 'grabhalo_inbox'),
)
Whollaaa ...謝謝:) – PythonEnthusiast