2

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

chepner
  • 497,756
  • 71
  • 530
  • 681
MecaTheclau
  • 188
  • 1
  • 3
  • 14
  • "from welcome import views", should this be in your base urls file? – Iain Shelvington Jan 11 '20 at 17:25
  • Your question and code seems to have no relation? – J Arun Mani Jan 11 '20 at 17:38
  • Does this answer your question? [What is the maximum recursion depth in Python, and how to increase it?](https://stackoverflow.com/questions/3323001/what-is-the-maximum-recursion-depth-in-python-and-how-to-increase-it) – J Arun Mani Jan 11 '20 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. – chepner Jan 11 '20 at 17:43
  • 1
    Is the `urls.py` file you showed located in `mysite/urls.py` ? – Lord Elrond Jan 11 '20 at 17:55

1 Answers1

8

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

Oleg Russkin
  • 4,234
  • 1
  • 8
  • 20