鏈接網址:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$',
include('distributors.urls', namespace='distributors')),
url(r'^accounts/', include('allauth.urls')),
]
應用網址:
url(r'^$', views.Index.as_view(), name='index'),
url(r'^links/$', login_required(views.LinkListView.as_view(), name='links'),
在我的HTML
我有href="{% url 'distributors:index' %}"
和href="{% url 'distributors:links' %}"
瀏覽:
class Index(TemplateView):
template_name = "distributors/index.html"
class LinkListView(ListView):
model = Link
template_name = "distributors/links.html"
context_object_name = 'links'
當我嘗試進入http://127.0.0.1:8000/我看到The included urlconf 'linker.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
任何想法如何解決這個問題?
分享你的linker.urls內容。 – moonstruck