0
我正在做django第一个应用教程。当我尝试访问本地主机网页时,出现最大深度递归错误。检查方法继续返回到最大深度。该代码是urls.py如下:Django教程最大深度递归
from django.contrib import admin
from django.conf.urls import include
from django.conf.urls import url
from polls import views
urlpatterns = [
url(r'^$', views.index, name ='index'),
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]
View.py:
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello World. You're at the polls index")
错误代码:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/urls/resolvers.py", line 255, in check
warnings.extend(check_resolver(pattern))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
RecursionError: maximum recursion depth exceeded
我能做些什么来解决这个问题? 谢谢
请包含来自民意调查模块的urls.py。无论您访问哪个视图,请将该视图包含完整的错误追溯。 –