RecursionError:超出最大递归深度。为什么

时间:2017-10-05 13:39:55

标签: python django

看来我做错了什么?无法配置我的网址。我有这个错误。 代码如下:

urls.py (Root,应用程序的主要网址)

from django.conf.urls import url, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static


urlpatterns =  [
    url(r'^admin/', admin.site.urls),
    url(r'', include('shop.urls', namespace='root_detail'))
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urls.py(我的网址)

from django.conf.urls import url
from . import views


urlpatterns =  [
    # Product list
    url(r'^$', views.product_list, name='product_list'),
    # Product list by category
    url(r'^(?P<category_slug>[-\w]+)/$', views.product_list, name='product_list_by_category'),
    # Product detail
    url(r'^(?P<category_slug>[-\w]+)/(?P<id>\d+)$', views.product_detail, name='product_detail'),
]

我有这个错误

  

RecursionError:超出最大递归深度

0 个答案:

没有答案