3

The traceback:

   File "/usr/lib/python3.7/inspect.py", line 3083, in signature
      return Signature.from_callabl`enter code here`e(obj, follow_wrapped=follow_wrapped)
    File "/usr/lib/python3.7/inspect.py"`enter code here`, li`enter code here`ne 2833, in from_callable
        follow_wrapper_chain`enter code here`s=follow_wrapped)
      File "/usr/lib/python3.7/inspect.py", line 2284, in _signature_from_callable
        return _signature_from_function(sigcls, obj)
      File "/usr/lib/python3.7/inspect.py", line 2154, in _signature_from_function
        kind=_POSITIONAL_OR_KEYWORD))
      File "/usr/lib/python3.7/inspect.py", line 2469, in __init__
        self._kind = _ParameterKind(kind)
      File "/usr/lib/python3.7/enum.py", line 310, in __call__
        return cls.__new__(cls, value)
      File "/usr/lib/python3.7/enum.py", line 530, in __new__
        if type(value) is cls:
RecursionError: maximum recursion depth exceeded while calling a Python object

urls.py

from django.contrib import admin
from django.urls import path, include
from welcome import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('mysite.urls')),
]

views.py

from django.shortcuts import render
from django.http import HttpResponse

def index(request):
    return HttpResponse("<h1>MyClub Event Calendar</h1>")

5
  • "from welcome import views", should this be in your base urls file? Commented Jan 11, 2020 at 17:25
  • Your question and code seems to have no relation? Commented Jan 11, 2020 at 17:38
  • Does this answer your question? What is the maximum recursion depth in Python, and how to increase it? Commented Jan 11, 2020 at 17:40
  • Most of the time, if you hit the maximum recursion depth, it has one of two causes: you are using recursion where you should be using a loop, or you have a bug in your recursive function. Here, it's not clear what code is triggering the error in the first place. Commented Jan 11, 2020 at 17:43
  • 1
    Is the urls.py file you showed located in mysite/urls.py ? Commented Jan 11, 2020 at 17:55

1 Answer 1

7

Check that include('mysite.urls')) points to another file (urls.py in another app), not this urls.py itself.

Sign up to request clarification or add additional context in comments.

1 Comment

I was able to recreate the RecursionError by doing this. So, this has to be the problem.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.