Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to solve maximum recursion depth exceeded while calling a Python object

Tags:

python

django

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>")

like image 828
MecaTheclau Avatar asked Apr 25 '26 17:04

MecaTheclau


1 Answers

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

like image 66
Oleg Russkin Avatar answered Apr 27 '26 05:04

Oleg Russkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!